POST /teams/{teamId}/boards/{id}/custom-fields/apply-preset
Cria no board os campos do(s) preset(s), idempotente e transacional
- Access: Team member
- Service:
https://api-workspace.axuz.net
Accepted authentication
sessionCookie— Sessão plena Axuz (cookie de sessão da casa). Sessão restrita é 403 enrollment_required.bearerSession— JWT de acesso da sessão em `Authorization: Bearer`.
Nao duplica por nome (comparacao sem diferenciar maiuscula). Devolve created (campos novos) e skipped (nomes que ja existiam). Mesma permissao de criar campo no board. preset_id OU preset_ids (<= 10); preset inexistente -> 404 e NADA e criado.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
teamId | path | string | yes | |
id | path | string | yes |
Request body
application/json · Required
| Name | Type | Required | Description |
|---|---|---|---|
preset_id | string | no | |
preset_ids | array<string> | no | |
lang | string | no | enum: |
{
"preset_id": "string",
"preset_ids": [
"string"
],
"lang": "pt"
}Responses
200
OK
| Name | Type | Required | Description |
|---|---|---|---|
created | array<CustomField> | yes | |
created[].id | string<uuid> | no | |
created[].board_id | string<uuid> | no | |
created[].name | string | no | |
created[].type | string | no | enum: |
created[].options | array<string> | no | |
created[].position | integer | no | |
skipped | array<string> | yes |
400
Erro ({"error": "..."})
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
401
Sem credencial valida
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
403
Sem permissao (nao e owner/admin; token sem escopo; token de integracao em rota nao permitida)
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
404
Erro ({"error": "..."})
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
409
Nunca (nome repetido vira skipped). Efeito: 1 tx no repo. Fluxo: "aplicar preset"
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
429
Limite de requisições excedido.
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
500
Erro interno. Tente de novo com backoff; reporte o X-Request-Id.
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
Examples
"Try it" is turned off in this reference. Use the examples with your test credential.
curl
curl -sS -X POST 'https://api-workspace.axuz.net/teams/TEAM_ID/boards/ID/custom-fields/apply-preset' \
-H "Authorization: Bearer $AXUZ_TOKEN" \
-H "Content-Type: application/json" \
-d '{"preset_id":"string","preset_ids":["string"],"lang":"pt"}'Node.js
const res = await fetch("https://api-workspace.axuz.net/teams/TEAM_ID/boards/ID/custom-fields/apply-preset", {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.AXUZ_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"preset_id": "string",
"preset_ids": [
"string"
],
"lang": "pt"
}),
});
if (!res.ok) throw new Error(`HTTP ${res.status}: ${await res.text()}`);
console.log(await res.json());Python
import os
import requests
res = requests.request(
"POST",
"https://api-workspace.axuz.net/teams/TEAM_ID/boards/ID/custom-fields/apply-preset",
headers={
"Authorization": f"Bearer {os.environ['AXUZ_TOKEN']}",
},
json={
"preset_id": "string",
"preset_ids": [
"string",
],
"lang": "pt",
},
timeout=30,
)
res.raise_for_status()
print(res.json())