POST /api/v1/api_keys/{key_id}/activate
Authenticate with Authorization: Bearer YOUR_API_KEY and X-Project-Id: YOUR_PROJECT_ID. Replace path placeholders and example values with your project's values.
Parameters
| Name | Location | Type | Presence | Description |
|---|---|---|---|---|
X-Project-Id | header | string (uuid) | Required | Project UUID. Use the project associated with your API key. |
key_id | path | string (uuid) | Required |
Examples
curl --request POST 'https://api.monoscope.tech/api/v1/api_keys/YOUR_KEY_ID/activate' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'X-Project-Id: YOUR_PROJECT_ID'import requests
response = requests.post(
"https://api.monoscope.tech/api/v1/api_keys/YOUR_KEY_ID/activate",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"X-Project-Id": "YOUR_PROJECT_ID"
},
timeout=30,
)
response.raise_for_status()
print(response.text)const response = await fetch("https://api.monoscope.tech/api/v1/api_keys/YOUR_KEY_ID/activate", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"X-Project-Id": "YOUR_PROJECT_ID"
},
});
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
console.log(await response.text());Responses
HTTP 200
Response defined by the API schema.
| Field | Type | Presence | Description |
|---|---|---|---|
active | boolean | Required | |
created_at | string (yyyy-mm-ddThh:MM:ssZ) | Required | |
id | string (uuid) | Required | |
key_prefix | string | Required | |
title | string | Required |
JSON schema
{
"properties": {
"active": {
"type": "boolean"
},
"created_at": {
"$ref": "#/components/schemas/UTCTime"
},
"id": {
"$ref": "#/components/schemas/UUID"
},
"key_prefix": {
"type": "string"
},
"title": {
"type": "string"
}
},
"required": [
"id",
"title",
"key_prefix",
"active",
"created_at"
],
"type": "object"
}HTTP 400
Refused; error.code says why
| Field | Type | Presence | Description |
|---|---|---|---|
error | object | Required |
JSON schema
{
"properties": {
"error": {
"$ref": "#/components/schemas/ApiProblem"
}
},
"required": [
"error"
],
"type": "object"
}HTTP 401
Refused; error.code says why
| Field | Type | Presence | Description |
|---|---|---|---|
error | object | Required |
JSON schema
{
"properties": {
"error": {
"$ref": "#/components/schemas/ApiProblem"
}
},
"required": [
"error"
],
"type": "object"
}HTTP 404
Refused; error.code says why
| Field | Type | Presence | Description |
|---|---|---|---|
error | object | Required |
JSON schema
{
"properties": {
"error": {
"$ref": "#/components/schemas/ApiProblem"
}
},
"required": [
"error"
],
"type": "object"
}