---
agent:
  instructions: "Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://docs.sendcorex.com/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://docs.sendcorex.com/llms.txt"
---

Source: https://docs.sendcorex.com/nl/api-reference/receive-emails/flags-labels/set-label-color

E-mails ontvangen: vlaggen en labels

# Set Label Color

Wijzig de kleur van een label.

POST `https://g.sendcorex.com/v1` command: set_label_color

## Argumenten

- `name` string verplicht
Het label.
- `color` string verplicht
Een van de kleuren uit List Labels.

## Snel starten

```
import axios from 'axios';

const response = await axios.post(
  'https://g.sendcorex.com/v1',
  {
    commands: [
      {
        command: "set_label_color",
        args: {
          name: "Clients",
          color: "teal"
        }
      }
    ]
  },
  { headers: { Authorization: process.env.SENDCOREX_TOKEN } },
);

const [result] = response.data.results;
if (result.type !== 'SUCCESS') throw new Error(`${result.code}: ${result.message}`);
console.log(result.data);
```

## Response

```
{
  "type": "SUCCESS",
  "results": [
    {
      "command": "set_label_color",
      "id": "0",
      "type": "SUCCESS",
      "data": {
        "id": "clients",
        "name": "Clients",
        "color": "teal"
      }
    }
  ]
}
```

## Fouten

Fouten op HTTP-niveau geven `type`, `code` en `message` terug. Fouten met CMD komen terug in het resultaat van de opdracht, met HTTP 200.

- 401`TOKEN_EXPIRED`
De access token is verlopen. Roep Refresh Token aan en herhaal het request.
- 401`INVALID_TOKEN`
De token is ongeldig, onbekend of ingetrokken.
- 429`RATE_LIMITED`
Meer dan 15 requests/s of 15 tegelijk voor hetzelfde IP + mailbox. Wacht het aantal seconden uit Retry-After.
- CMD`INVALID_ARGS`
Een verplicht argument ontbreekt of is ongeldig.
- CMD`NOT_FOUND`
Het bericht, de thread of de map bestaat niet voor deze token.
- CMD`INTERNAL`
Serverfout. Het detail wordt alleen in het serverlog geschreven.
