Migrations
Migrate an API key
Migrations
Migrate an API key
POST
/
api
/
v1
/
api-key
/
migrate
curl --request POST \
--url https://prod.oneloop.ai/api/v1/api-key/migrate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"key": "<string>",
"name": "<string>",
"workspaceId": "<string>",
"scopes": [
{
"representation": "<string>",
"create": true,
"read": true,
"update": true,
"del": true
}
],
"enabled": true,
"customerId": "<string>",
"metadata": {}
}'
{
"apiKey": {
"id": "<string>",
"name": "<string>",
"maskedKey": "<string>",
"prefix": "<string>",
"expiresAt": 1,
"scopes": [
{
"id": "<string>",
"representation": "<string>",
"create": true,
"read": true,
"update": true,
"del": true
}
],
"enabled": true,
"customerId": "<string>",
"deleted": true,
"createdAt": "<string>",
"updatedAt": "<string>",
"lastUsedAt": "<string>",
"billingId": "<string>",
"key": "<string>"
}
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
application/json
Response
200
application/json
The migrated key
Required range:
x > 0
curl --request POST \
--url https://prod.oneloop.ai/api/v1/api-key/migrate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"key": "<string>",
"name": "<string>",
"workspaceId": "<string>",
"scopes": [
{
"representation": "<string>",
"create": true,
"read": true,
"update": true,
"del": true
}
],
"enabled": true,
"customerId": "<string>",
"metadata": {}
}'
{
"apiKey": {
"id": "<string>",
"name": "<string>",
"maskedKey": "<string>",
"prefix": "<string>",
"expiresAt": 1,
"scopes": [
{
"id": "<string>",
"representation": "<string>",
"create": true,
"read": true,
"update": true,
"del": true
}
],
"enabled": true,
"customerId": "<string>",
"deleted": true,
"createdAt": "<string>",
"updatedAt": "<string>",
"lastUsedAt": "<string>",
"billingId": "<string>",
"key": "<string>"
}
}