TAŇBA-OOH Разработчикам

Save a structure set

POST /api/v1/structure-sets

https://app.tanba-ooh.kz/api/v1/structure-sets

Технический текст справочника написан на английском.

Scope write:submissions. Up to 2000 structures; an operator may only list its own. Names are unique within the organisation (409 structure_set_name_taken).

Аутентификация

Ключ API в заголовке Authorization или сессия консоли.

Право доступа: write:submissions

Тело запроса

application/json

StructureSetInput

ИмяТипОбязательныйОписаниеПример
namestringдаName, unique within the organisation."Almaty city boards"
structure_idsarray of string (uuid)даStructures of the set; repeats are dropped.["0b6f9d0e-6c1e-4a6a-9d55-0f8a6a6f3c11"]

Пример

{
  "name": "Almaty city boards",
  "structure_ids": [
    "0b6f9d0e-6c1e-4a6a-9d55-0f8a6a6f3c11"
  ]
}

Ответы

201 The saved set.

application/json

StructureSet

ИмяТипОбязательныйОписаниеПример
idstring (uuid)даId of the set."5d3f3e0a-2a53-4b3c-8d0a-6f63b4d9a111"
namestringдаName, unique within the organisation."Almaty city boards"
structure_idsarray of string (uuid)даStructures of the set in the order given.["0b6f9d0e-6c1e-4a6a-9d55-0f8a6a6f3c11"]
created_atstringдаWhen the set was saved first."2026-10-14T10:00:00+05:00"
updated_atstringдаWhen the set was last changed."2026-10-14T10:00:00+05:00"

Пример

{
  "id": "5d3f3e0a-2a53-4b3c-8d0a-6f63b4d9a111",
  "name": "Almaty city boards",
  "structure_ids": [
    "0b6f9d0e-6c1e-4a6a-9d55-0f8a6a6f3c11"
  ],
  "created_at": "2026-10-14T10:00:00+05:00",
  "updated_at": "2026-10-14T10:00:00+05:00"
}

Ошибки

Ошибки приходят документом problem (application/problem+json) со стабильным полем code.

СтатусЗначение
401Нет действительной сессии или ключа API (unauthenticated, session_expired, invalid_api_key).
403Роль или право ключа этого не допускает (forbidden, key_scope_denied, key_route_denied).
409Ошибка в виде документа problem.
422Ошибки полей (validation_failed).
defaultОшибка в виде документа problem.

Примеры кода

curl

curl -X POST 'https://app.tanba-ooh.kz/api/v1/structure-sets' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "Almaty city boards",
  "structure_ids": [
    "0b6f9d0e-6c1e-4a6a-9d55-0f8a6a6f3c11"
  ]
}'
Python
import requests

response = requests.post(
    "https://app.tanba-ooh.kz/api/v1/structure-sets",
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json",
    },
    json={
        "name": "Almaty city boards",
        "structure_ids": [
            "0b6f9d0e-6c1e-4a6a-9d55-0f8a6a6f3c11",
        ],
    },
)
print(response.status_code, response.text)
Go
package main

import (
	"fmt"
	"io"
	"net/http"
	"strings"
)

func main() {
	body := strings.NewReader(`{
  "name": "Almaty city boards",
  "structure_ids": [
    "0b6f9d0e-6c1e-4a6a-9d55-0f8a6a6f3c11"
  ]
}`)
	req, err := http.NewRequest("POST", "https://app.tanba-ooh.kz/api/v1/structure-sets", body)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
	req.Header.Set("Content-Type", "application/json")
	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()
	data, _ := io.ReadAll(resp.Body)
	fmt.Println(resp.Status, string(data))
}