Skip to main content
POST
https://enterprise.spacemedia.uk
/
api
/
v1
/
account-settings
/
labels
Create Custom Label
curl --request POST \
  --url https://enterprise.spacemedia.uk/api/v1/account-settings/labels \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Demo Label"
}
'
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({name: 'Demo Label'})
};

fetch('https://enterprise.spacemedia.uk/api/v1/account-settings/labels', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://enterprise.spacemedia.uk/api/v1/account-settings/labels",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'name' => 'Demo Label'
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
import requests

url = "https://enterprise.spacemedia.uk/api/v1/account-settings/labels"

payload = { "name": "Demo Label" }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
{
  "success": true,
  "data": {
    "id": "9d7046b2-3ab1-4c9d-9bd8-90bbd22b7df2",
    "organization_id": "2a8d3e82-4a9d-4e33-9d3b-85bb1a93e8d4",
    "organization_uuid": "2a8d3e82-4a9d-4e33-9d3b-85bb1a93e8d4",
    "name": "Maya Chen",
    "email": "maya.chen@example.test",
    "roles": [
      {
        "id": "role-admin-demo",
        "uuid": "role-admin-demo",
        "name": "Admin"
      }
    ]
  }
}
{
  "success": false,
  "message": "Missing bearer token"
}
{
  "success": false,
  "message": "This action is unauthorized."
}
{
  "success": false,
  "message": "Resource not found"
}
{
  "success": false,
  "message": "Validation failed.",
  "errors": {
    "title": [
      "The title field is required."
    ]
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Accept
string

Use application/json for API responses.

Authorization
string

Bearer access token. Use Bearer <YOUR_ACCESS_TOKEN>.

Body

application/json

The body is of type object.

Response

Success

The response is of type object.