Bind API key to sandbox organisation
PUT/v2/config/admin/apikey/:apiKeyId/sandbox-org
Binds an API key to a sandbox organisation, or binds it back to the main wallet.
Send the identifier of the sandbox organisation in the body: {"sandboxOrgId": "6889e1a4c5b2f30001a3d710"}. Send an empty string to bind the key back to the main wallet of the organisation. The sandbox organisation must belong to your organisation and must be deployed; if it does not exist, or if it is not deployed, the service gives HTTP 400.
The service signs a new token for the key, with the new sandbox organisation in its claims. The apiKey field of the response holds this new token. The token that you had before this call stops working, so store the new value and replace the old one in every client.
After the binding, every call that you make with this key runs in the context of that sandbox organisation. The key then reads and writes the credential definitions, the presentation definitions, the webhooks and the keys of that sandbox organisation, and not those of the main wallet. The service takes the sandbox organisation from the key itself, so a request with this key does not need the X-SandboxOrgId header, and the service ignores that header.
The service also moves the expiry of the key forward. It sets a new expiryTimestamp at the moment of this call plus the current expiryInDays, so every call to this operation extends the lifetime of the key.
Request
Path Parameters
Unique ID of an object
- application/json
Body
required
The sandbox organisation to bind the API key to.
Identifier of the sandbox organisation to bind the API key to. Send an empty string, or leave the field out, to bind the key back to the main wallet of the organisation.
Responses
- 200
- 400
- 401
- 403
- 404
- 500
The service bound the API key and signed a new token. Store the value of the apiKey field; the previous token no longer works.
Response Headers
- application/json
- Schema
- Example (from schema)
- Example
Schema
apiKey objectrequired
The API key after the binding, with the new token and the new expiry.
Unique identifier of the API key.
Name of the API key. The service does not check this value for uniqueness.
Possible values: [config, audit, service, onboard]
Scopes of the API key. Each scope opens a group of endpoints. The service refuses any other value with HTTP 400.
The signed JSON Web Token. Send it as Authorization: ApiKey <apiKey>. The token holds the scopes, the organisation, the organisation administrator and, when the key is bound to a sandbox organisation, the sandbox organisation.
Default value: 30
Lifetime of the API key in days, counted from the moment the service created or last updated the key. The service uses 30 days when you send 0 or a negative value.
Moment when the service last wrote the API key, in UTC. The service sets this value on create and on every update, including the delete operation.
Moment when the API key expires, in UTC.
Possible values: [igrantio, aip10]
Type of the API key. The list operation returns only keys of type igrantio; these are the keys that you create with this group of operations.
Identifier of the sandbox organisation that the API key is bound to. The field is absent when the key belongs to the main wallet of the organisation.
createdBy objectrequired
The user who created the API key, and the moment of creation. The service keeps this as log metadata.
Identifier of the user who created the API key. The value is an empty string for a key created with an API key.
Email address of the user who created the API key.
Moment of creation, in UTC.
{
"apiKey": {
"id": "6889e1a4c5b2f30001a3d720",
"name": "Production issuance key",
"scopes": [
"config",
"service"
],
"apiKey": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJTY29wZXMiOlsiY29uZmlnIl0...",
"expiryInDays": 30,
"timestamp": "2026-08-09T10:15:30Z",
"expiryTimestamp": "2026-09-08T10:15:30Z",
"type": "igrantio",
"sandboxOrgId": "6889e1a4c5b2f30001a3d710",
"createdBy": {
"id": "6889e1a4c5b2f30001a3d6e0",
"email": "[email protected]",
"at": "2026-08-09T10:15:30Z"
}
}
}
{
"apiKey": {
"id": "6889e1a4c5b2f30001a3d720",
"name": "Production issuance key",
"scopes": [
"config",
"service"
],
"apiKey": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJTY29wZXMiOlsiY29uZmlnIl0...",
"expiryInDays": 30,
"timestamp": "2026-08-09T13:20:44Z",
"expiryTimestamp": "2026-09-08T13:20:44Z",
"type": "igrantio",
"sandboxOrgId": "6889e1a4c5b2f30001a3d710",
"createdBy": {
"id": "6889e1a4c5b2f30001a3d6e0",
"email": "[email protected]",
"at": "2026-08-09T10:15:30Z"
}
}
}
The sandbox organisation of sandboxOrgId does not exist in your organisation, or it is not deployed.
Response Headers
- application/json
- Schema
- Example (from schema)
Schema
{
"errorCode": 400,
"errorDescription": "Bad input parameter"
}
Unauthorized
Response Headers
- application/json
- Schema
- Example (from schema)
Schema
{
"errorCode": 400,
"errorDescription": "Bad input parameter"
}
The caller has no permission for this operation.
Response Headers
- application/json
- Schema
- Example (from schema)
Schema
{
"errorCode": 400,
"errorDescription": "Bad input parameter"
}
The API key of apiKeyId does not exist, or it is deleted.
Response Headers
- application/json
- Schema
- Example (from schema)
Schema
{
"errorCode": 400,
"errorDescription": "Bad input parameter"
}
The service could not sign the new token, or could not write the API key.
Response Headers
- application/json
- Schema
- Example (from schema)
Schema
{
"errorCode": 400,
"errorDescription": "Bad input parameter"
}