API reference
Tags
7 operations. Base URL https://api.scarleta.ai. Select an operation to see its parameters, samples and errors.
Jump to an operation
POST/v1/audio/tags/adoptTurn a suggested tag into your own
Free and paid accounts
- API key required
- Free and paid accounts
- No token cost
Adds a tag Scarleta suggested (auto_tags in the tag list) to every file it was suggested for, as one of your own tags, optionally under another name (as). Files that already have the tag are not changed. A suggested tag that does not exist changes nothing and returns updated: 0. Counts against the hourly account request budget. Available to free and paid accounts.
Cost. Free of charge.
curl -X POST "https://api.scarleta.ai/v1/audio/tags/adopt" \
-H "Authorization: Bearer $SCARLETA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"auto_tag": "speech",
"as": "talk"
}'Request body
| Name | Type | Required | Description |
|---|---|---|---|
| auto_tagbody | string | Required | The suggested tag, 1 to 64 characters. |
| asbody | string | Optional | The name to give it, 1 to 64 characters. Defaults to the suggested name. |
Response fields
| Field | Type | Description |
|---|---|---|
| updated | integer | Files whose tags changed. Allowed: -9007199254740991 to 9007199254740991. |
Errors
| Status | Code | Description |
|---|---|---|
| 400 | invalid_tag | The body is invalid JSON, or a name is empty or too long (`tag_too_long`). |
| 401 | invalid_key | Missing, malformed, unknown or revoked API key. |
| 429 | rate_limit_exceeded | Over the account request budget. Wait for the `Retry-After` header, then retry. |
| 503 | db_unavailable | The tag could not be adopted. Retry shortly. |
Example responses
{
"data": {
"updated": 8
},
"meta": {
"request_id": "req_0b7a3c2e-6f1d-4d9a-8e55-3a4b5c6d7e8f"
}
}- 200 The number of files that gained the tag.
- 400 The body is invalid JSON, or a name is empty or too long (`tag_too_long`).
- 401 Missing, malformed, unknown or revoked API key.
- 429 Over the account request budget. Wait for the `Retry-After` header, then retry.
- 503 The tag could not be adopted. Retry shortly.
Try it
Sends this request from your browser to https://api.scarleta.ai with your own key. The key stays in this page only (never saved or put in the address) and is cleared when you leave. Revoke any key you have shared.
Other error codes this operation can return: auth_unavailable, invalid_auth_format, invalid_json, invalid_key_format, missing_api_key, missing_auth, rate_limit_unavailable, tag_too_long, unauthorized.
PUT/v1/audio/tags/colorSet a tag color
Free and paid accounts
- API key required
- Free and paid accounts
- No token cost
Sets the color of a tag, or clears it with color: null. The color is kept for the tag name even when no file carries it at the moment. Allowed colors: red, orange, amber, green, teal, blue, purple, pink, gray. Counts against the hourly account request budget. Available to free and paid accounts.
Cost. Free of charge.
curl -X PUT "https://api.scarleta.ai/v1/audio/tags/color" \
-H "Authorization: Bearer $SCARLETA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "morning",
"color": "blue"
}'Request body
| Name | Type | Required | Description |
|---|---|---|---|
| namebody | string | Required | The tag, 1 to 64 characters. |
| colorbody | "red" | "orange" | "amber" | "green" | "teal" | "blue" | "purple" | "pink" | "gray" | null | Required | A color, or `null` to clear it. |
Response fields
| Field | Type | Description |
|---|---|---|
| name | string | |
| color | string | null |
Errors
| Status | Code | Description |
|---|---|---|
| 400 | invalid_color | The body is invalid JSON, the name is empty or too long, or the color is not an allowed one. |
| 401 | invalid_key | Missing, malformed, unknown or revoked API key. |
| 429 | rate_limit_exceeded | Over the account request budget. Wait for the `Retry-After` header, then retry. |
| 503 | db_unavailable | The color could not be saved. Retry shortly. |
Example responses
{
"data": {
"name": "morning",
"color": "blue"
},
"meta": {
"request_id": "req_0b7a3c2e-6f1d-4d9a-8e55-3a4b5c6d7e8f"
}
}- 200 The tag and its color after the change.
- 400 The body is invalid JSON, the name is empty or too long, or the color is not an allowed one.
- 401 Missing, malformed, unknown or revoked API key.
- 429 Over the account request budget. Wait for the `Retry-After` header, then retry.
- 503 The color could not be saved. Retry shortly.
Try it
Sends this request from your browser to https://api.scarleta.ai with your own key. The key stays in this page only (never saved or put in the address) and is cleared when you leave. Revoke any key you have shared.
Other error codes this operation can return: auth_unavailable, invalid_auth_format, invalid_json, invalid_key_format, invalid_tag, missing_api_key, missing_auth, rate_limit_unavailable, tag_too_long, unauthorized.
POST/v1/audio/tags/renameRename a tag
Free and paid accounts
- API key required
- Free and paid accounts
- No token cost
Renames a tag on every file that carries it. If a file already has the new name the two merge. The tag's color moves to the new name. Renaming a tag nothing carries changes nothing and returns updated: 0. Counts against the hourly account request budget. Available to free and paid accounts.
Cost. Free of charge.
curl -X POST "https://api.scarleta.ai/v1/audio/tags/rename" \
-H "Authorization: Bearer $SCARLETA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": "demo",
"to": "draft-demo"
}'Request body
| Name | Type | Required | Description |
|---|---|---|---|
| frombody | string | Required | The tag to rename, 1 to 64 characters. |
| tobody | string | Required | The new name, 1 to 64 characters. |
Response fields
| Field | Type | Description |
|---|---|---|
| updated | integer | Files whose tags changed. Allowed: -9007199254740991 to 9007199254740991. |
Errors
| Status | Code | Description |
|---|---|---|
| 400 | invalid_tag | The body is invalid JSON, or a name is empty, or too long (`tag_too_long`). `error.details.field` names it. |
| 401 | invalid_key | Missing, malformed, unknown or revoked API key. |
| 429 | rate_limit_exceeded | Over the account request budget. Wait for the `Retry-After` header, then retry. |
| 503 | db_unavailable | The tag could not be renamed. Retry shortly. |
Example responses
{
"data": {
"updated": 3
},
"meta": {
"request_id": "req_0b7a3c2e-6f1d-4d9a-8e55-3a4b5c6d7e8f"
}
}- 200 The number of files changed.
- 400 The body is invalid JSON, or a name is empty, or too long (`tag_too_long`). `error.details.field` names it.
- 401 Missing, malformed, unknown or revoked API key.
- 429 Over the account request budget. Wait for the `Retry-After` header, then retry.
- 503 The tag could not be renamed. Retry shortly.
Try it
Sends this request from your browser to https://api.scarleta.ai with your own key. The key stays in this page only (never saved or put in the address) and is cleared when you leave. Revoke any key you have shared.
Other error codes this operation can return: auth_unavailable, invalid_auth_format, invalid_json, invalid_key_format, missing_api_key, missing_auth, rate_limit_unavailable, tag_too_long, unauthorized.
POST/v1/audio/tags/selection-stateCount tags across a selection of files
Free and paid accounts
- API key required
- Free and paid accounts
- No token cost
For the files you name, returns each tag they carry with how many of those files carry it, so a tag that is on all of them can be told from one that is on some. Files that are not yours, and files in the trash, are left out. Counts against the hourly account request budget. Available to free and paid accounts.
Cost. Free of charge.
curl -X POST "https://api.scarleta.ai/v1/audio/tags/selection-state" \
-H "Authorization: Bearer $SCARLETA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"audio_ids": [
"audio_bbb14949dc19"
]
}'Request body
| Name | Type | Required | Description |
|---|---|---|---|
| audio_idsbody | array<string> | Required | The selection: library identifiers (`audio_id`) or storage identifiers (`file_id`) of your files, 1 to 5000. |
Errors
| Status | Code | Description |
|---|---|---|
| 400 | missing_audio_ids | The `audio_ids` list is missing, empty, or not a list of strings. |
| 401 | invalid_key | Missing, malformed, unknown or revoked API key. |
| 429 | rate_limit_exceeded | Over the account request budget. Wait for the `Retry-After` header, then retry. |
| 503 | db_unavailable | The tags could not be read. Retry shortly. |
Example responses
{
"data": {
"morning": 2,
"demo": 1
},
"meta": {
"request_id": "req_0b7a3c2e-6f1d-4d9a-8e55-3a4b5c6d7e8f"
}
}- 200 Tag counts for the selection. An empty object when no tag applies.
- 400 The `audio_ids` list is missing, empty, or not a list of strings.
- 401 Missing, malformed, unknown or revoked API key.
- 429 Over the account request budget. Wait for the `Retry-After` header, then retry.
- 503 The tags could not be read. Retry shortly.
Try it
Sends this request from your browser to https://api.scarleta.ai with your own key. The key stays in this page only (never saved or put in the address) and is cleared when you leave. Revoke any key you have shared.
Other error codes this operation can return: auth_unavailable, invalid_auth_format, invalid_json, invalid_key_format, missing_api_key, missing_auth, rate_limit_unavailable, too_many_audio_ids, unauthorized.