from line 195
195195
196196 ID of the user profile the key is bound to, or null if the key is not bound to one. A key bound to a user profile can only be attached to a Workspace that has the same user profile. A key that isn't bound can only be attached to a Workspace that has no user profile.
197197
198### Errors
199
200Any method can also return the general [HTTP errors](https://platform.claude.com/docs/en/api/errors?sdk_languages=http).
201
202Each code below is the value of `error.details.error_code` in the response body.
203
204- `user_profile_not_found` (HTTP status 400)
205
206 The request depends on a user profile that does not exist in the organization or is no longer active. The request either names this user profile by ID, or names a resource, such as an External Key, that is bound to it.
207
208- `sandbox_egress_restricted` (HTTP status 403)
209
210 The request came from a Claude sandbox with restricted network access, which is not allowed to make this change. Send it from outside the sandbox, or from a sandbox with unrestricted network access.
211
198212### Example
199213
200214```bash
from line 774
760774
761775 ID of the user profile the key is bound to, or null if the key is not bound to one. A key bound to a user profile can only be attached to a Workspace that has the same user profile. A key that isn't bound can only be attached to a Workspace that has no user profile.
762776
777### Errors
778
779Any method can also return the general [HTTP errors](https://platform.claude.com/docs/en/api/errors?sdk_languages=http).
780
781Each code below is the value of `error.details.error_code` in the response body.
782
783- `external_key_in_workspace_policy` (HTTP status 400)
784
785 The External Key can't be deleted or reconfigured while the organization's Workspace Policy lists it as an allowed key.
786
787- `sandbox_egress_restricted` (HTTP status 403)
788
789 The request came from a Claude sandbox with restricted network access, which is not allowed to make this change. Send it from outside the sandbox, or from a sandbox with unrestricted network access.
790
763791### Example
764792
765793```bash
from line 855
827855
828856 ID of the deleted External Key.
829857
858### Errors
859
860Any method can also return the general [HTTP errors](https://platform.claude.com/docs/en/api/errors?sdk_languages=http).
861
862Each code below is the value of `error.details.error_code` in the response body.
863
864- `external_key_in_workspace_policy` (HTTP status 400)
865
866 The External Key can't be deleted or reconfigured while the organization's Workspace Policy lists it as an allowed key.
867
868- `sandbox_egress_restricted` (HTTP status 403)
869
870 The request came from a Claude sandbox with restricted network access, which is not allowed to make this change. Send it from outside the sandbox, or from a sandbox with unrestricted network access.
871
830872### Example
831873
832874```bash
from line 932
890932
891933 - `"success"`
892934
935### Errors
936
937Any method can also return the general [HTTP errors](https://platform.claude.com/docs/en/api/errors?sdk_languages=http).
938
939Each code below is the value of `error.details.error_code` in the response body.
940
941- `sandbox_egress_restricted` (HTTP status 403)
942
943 The request came from a Claude sandbox with restricted network access, which is not allowed to make this change. Send it from outside the sandbox, or from a sandbox with unrestricted network access.
944
893945### Example
894946
895947```bash
from line 1149
10971149
10981150- `ExternalKeyChangedErrorDetails object`
10991151
1100 The external key changed while the request was validating it. Send the request again.
1101
11021152 - `error_code: "external_key_changed"`
11031153
11041154### External Key In Workspace Policy Error Details
from line 1155
11051155
11061156- `ExternalKeyInWorkspacePolicyErrorDetails object`
11071157
1108 The External Key can't be deleted or reconfigured while the organization's Workspace Policy lists it as an allowed key.
1109
11101158 - `error_code: "external_key_in_workspace_policy"`
11111159
11121160### External Key Unattached Attachment
from line 1169
11211169
11221170- `ExternalKeyValidationFailedErrorDetails object`
11231171
1124 The External Key failed Anthropic's validation, so the request was refused. The message gives the reason, if there is one.
1125
11261172 - `error_code: "external_key_validation_failed"`
11271173
11281174### External Key Validation Timed Out Error Details
from line 1175
11291175
11301176- `ExternalKeyValidationTimedOutErrorDetails object`
11311177
1132 Anthropic's validation of the External Key did not finish in time, so the request was refused. Wait a moment, then send the request again.
1133
11341178 - `error_code: "external_key_validation_timed_out"`
11351179
11361180### GCP External Key Config
from line 1223
11791223 - `"failure"`
11801224
11811225 - `"success"`
1226
1227## Errors
1228
1229### external_key_in_workspace_policy
1230
1231HTTP status 400
1232
1233- `"external_key_in_workspace_policy"`
1234
1235 The External Key can't be deleted or reconfigured while the organization's Workspace Policy lists it as an allowed key.
1236
1237 - `details: ExternalKeyInWorkspacePolicyErrorDetails`
1238
1239 - `error_code: "external_key_in_workspace_policy"`
1240
1241### external_key_validation_failed
1242
1243HTTP status 400
1244
1245- `"external_key_validation_failed"`
1246
1247 The External Key failed Anthropic's validation, so the request was refused. The message gives the reason, if there is one.
1248
1249 - `details: ExternalKeyValidationFailedErrorDetails`
1250
1251 - `error_code: "external_key_validation_failed"`
1252
1253### external_key_validation_timed_out
1254
1255HTTP status 400
1256
1257- `"external_key_validation_timed_out"`
1258
1259 Anthropic's validation of the External Key did not finish in time, so the request was refused. Wait a moment, then send the request again.
1260
1261 - `details: ExternalKeyValidationTimedOutErrorDetails`
1262
1263 - `error_code: "external_key_validation_timed_out"`
1264
1265### external_key_changed
1266
1267HTTP status 409
1268
1269- `"external_key_changed"`
1270
1271 The external key changed while the request was validating it. Send the request again.
1272
1273 - `details: ExternalKeyChangedErrorDetails`
1274
1275 - `error_code: "external_key_changed"`
11821276