Документация предоставляет всю информацию, необходимую вам для работы с нашим API.
Для аутентификации запросов передайте Authorization заголовок со значением "Bearer {YOUR_AUTH_KEY}".
Все аутентифицированные конечные точки помечены как requires authentication в документации ниже.
Вы можете получить токен, выполнив аутентификацию:
Для обычных методов: api/v1/auth/login.
Для API клиентов (api/v1/client/*): api/v1/client/login.
Взаимодействие от имени пользователя
access_token является JWT.
Пример payload:
{
"aud": "9e196de3-9324-47c8-9bca-27b633af08c1",
"jti": "219e04228fab177899a53e9ce294b77809b12f9306c4c9794ad8a7602b888bbcc233c4ee9661dafe",
"iat": 1739180144.815972, // issued at time
"nbf": 1739180144.815974,
"exp": 1740389744.806619, // expire time
"sub": "00000000-0000-4000-8001-000000000002", // user_id
"scopes": []
}
curl --request POST \
"https://id.stage.odinn.cloud/api/v1/auth/login" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"tempore\",
\"password\": \"tq=mFxZO,\"
}"
{
"token_type": "Bearer",
"expires_in": 120960,
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiI5ZTE5NmRlMy05MzI0LTQ3YzgtOWJjYS0yN2I2MzNhZjA4YzEiLCJqdGkiOiIyMTllMDQyMjhmYWIxNzc4OTlhNTNlOWNlMjk0Yjc3ODA5YjEyZjkzMDZjNGM5Nzk0YWQ4YTc2MDJiODg4YmJjYzIzM2M0ZWU5NjYxZGFmZSIsImlhdCI6MTczOTE4MDE0NC44MTU5NzIsIm5iZiI6MTczOTE4MDE0NC44MTU5NzQsImV4cCI6MTc0MDM4OTc0NC44MDY2MTksInN1YiI6IjAwMDAwMDAwLTAwMDAtNDAwMC04MDAxLTAwMDAwMDAwMDAwMiIsInNjb3BlcyI6W119.ilMKDdtK8-K4lItpPPRpGNSCxrczHMvlD2gmU_KD8lQFgJp0eL9Jql11O7j5xuY0mOnrTEWGncbDCNtBShLsU7jhlBdQ6r9nfwUJhazGBymaJh_zk2X0I400mFGXuSLqzUo4TnDjRpc3Lx9mYprqFGJ6LqiFfX9jfxsqelqL2EHrDIOhWUrEIZDmPvkS7IWonxMMHhy-M8vpGtfXkOvYeKSzj1liGG_96HkjRqRAC9B36brC_AgYfQ4Lo1RAgkJnWDrsZNg3JhSQmxFAfrnfBlsQq2EnWoW5BSfDQHE1yHQ4n5BHFhigkFjnU_7Q_kXrBHhALPXW9nroztv_U62fS1LFachXLEJx215cYtt_u_Tpjs0WTAR-P1sOqa3l8i0YhLc3fQYr_48GlHoXvjFk6h7Hh6jJhGP9x-qPp-UyxmTCjFLlPslfrevOwOfRi7i2Z4fLUGezwr-LXDEn0dStBfuQl9E6j8gaGm84xu06spMPZF-zNHQDnrB_tJuF2-05FRSRa9jXjakqncXRIuHulZBXsJK-K2-jLvAUghAWr_2lTmhmYvpKpo7pykRk2-KRV8p4Ic-YD1IC-AoCpkqgAC3C5Z-Dq2um8RWb3K78-v7LA9alPX9_Y4lpYDOtUj8Rt-6ExEPSGmyBYKmGclFJ-4ugqGWtqLvVhLT5AjESkKk",
"refresh_token": "def50200ededbd90f2ab17b07f3f06e88aa1ae7f7185931f2eecd24c49003aa823c7682795ca2b067c84a80e8778ea541aac1c92f8b1ec4976cb34a7ea5ef131281c530157fc752b78b76e4329e23a18bb9af4f85f670a1e149f68f2e762df1e20327d7888c4191af705227165f50dc281012d7b2c9345a629cf7061af712fd1d988e1454cf9700138c5cc297a40286ff5821d057bec3f4ebb7cbbc71ee8a1a7bbc47bd273ea1822de1ca52571bde28482611a88d8ecd1a2cb0524a583eedfbfc8f923469d196e3b4377aae0aa093c2a4c3a38ce717c20b378f9cc49269615728317a18b4a41fbd84a1e4247991b0629f5ae6990288b16aeed3754ccc2de037b1bba577b855dbdd65ae782aefb86a86326a5bb7d879b9bce919b72b0e1f0db67cc55bb3b90931986385e6ce13557c202f4e30c8d47d7fb5fedb1acef8d50087d595405a94177bf22fec406b5d445925cc57c05a9fd9a3dbda28cfaf07bca507910b520b9a35fc7cf7603b38d745389d9fea79083414a65e305af640f738ad14c01dd05d14e8efe199be8b1cd185a34285dbb21afb3a94072903282dfa05670393d823dc07408f1661c",
"logged_in_at": "2025-02-10T09:35:44.806157Z",
"user": {
"id": "00000000-0000-4000-8001-000000000002",
"name": "Test Admin",
"username": "admin",
"email": "almaximal+admin@ya.ru",
"phone": null,
"email_verified_at": null,
"deleted_at": null,
"created_at": "2025-02-06T10:34:15.000000Z",
"updated_at": "2025-02-06T10:34:15.000000Z",
"roles": [
{
"id": "9e257a75-2de3-4607-99db-91cf7c73850f",
"code": "admin",
"name": "Админ",
"params": null,
"notes": null,
"author_id": null,
"created_at": "2025-02-06T10:34:14.000000Z",
"updated_at": "2025-02-06T10:34:14.000000Z",
"permissions": [
{
"id": "00000000-0000-0000-0002-000000000001",
"code": "roles:list",
"verb": "просматривать все роли",
"title": "Просмотр всех ролей",
"params": null,
"notes": null,
"author_id": null,
"created_at": "2025-02-06T10:34:14.000000Z",
"updated_at": null
}
]
}
]
}
}
curl --request POST \
"https://id.stage.odinn.cloud/api/v1/auth/refresh" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"refresh_token\": \"ut\"
}"
{
"token_type": "Bearer",
"expires_in": 120960,
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiI5ZTE5NmRlMy05MzI0LTQ3YzgtOWJjYS0yN2I2MzNhZjA4YzEiLCJqdGkiOiI3MjAxNDMxZDEzZmMxNGRhYjA0NjY2NjI2NDgxZTA0MzVkOTA3ZDg1OTA5Nzk0MTBlYTA5N2VkYWFlNTg4M2E5YmU1YjRiYjU4MTI5NDU2OSIsImlhdCI6MTczOTE4MDU0Mi4zNDg3LCJuYmYiOjE3MzkxODA1NDIuMzQ4NzAyLCJleHAiOjE3NDAzOTAxNDIuMzQxNjAzLCJzdWIiOiIwMDAwMDAwMC0wMDAwLTQwMDAtODAwMS0wMDAwMDAwMDAwMDIiLCJzY29wZXMiOltdfQ.u7mqxZI343AWM1iEZwJ-i7PMsdUKT162z6HurihK_4nPAusQa14JmAnZg9_k2MukvyYf9xjdZPKM37MyvXEcFpJUlq61JQ-pB8D955dDJ7XEkeWuEnPODnhZYS56X-Xxa6Ut1E-7r-D5J2VX5TLi59Zs8ZWJ96kvsDysU21O93Wo0jht7KoJ-M33mZYZgvbyVXcnc1MS8JEGGXQaSAMe9z9XqPWYGLT3PDM-9mvdBRJBaBC2m__bYl01MF-IySznP4e13pAm7yDhuCpNkvg9Z30G7D0fPYZCF08oZ9sXJvFKzV_6fyz4IpIsteTmNuQ1g1cDAVHGg0upMMTulKBPap0a2IdHT8UGLig6MXxAka4ECUCV7ILXAq1IBXNrnWQ0k1YqwPPmsSoGYu80m9l2VJd6NmDMkVMeqdllvlIYh2diRe6tRkcvH0yGbwl2OAnDedAHMIYJwWbhXsxjB_Pd1_dSb1mR29lOCWtbN2TVksProHxTbhGv2qjNv3N1UgO8XuyC2N1HHjiq1L6ijpoFT58BK-yh_C5JfCpCzXb-c8n5HZnUln_Nhmn-MxT_CZ3KAmeHdiHlaINhacUj6_JimCE0EOGC0c8XuW_OxvF9MOiLPcKkPC6_Y8DE0q0Fzy1ik42ZGcFiSGaRKSqY6jETfj-WphZonBNgx3IBcUUW54Y",
"refresh_token": "def50200a554a490c59e09811dc700f8f34bc52236c9b316e503fe89c2294c8395912517654fad3600c8ae4850e52f649600846a9d887163f0c5b5df93d1379dc0fbd4dd0636a3b83dfb9a2b897c06bc0a882f67837e3d425d272ef8e4c32f68e53ab39ba503802b05b0e37a6cf084200213c02faa559ecc03316d09777658bd69919dcb8e5a332a8e0e94ddd4b26673d5d11c2ac5871c9d618667299129ed9dbbec8621b5eca62e40a7e5ec5029094d68b53094bed74c9c3977577be4d147059a110a27b0e22d580e677897ce1131d8cae2353c7dad9694bcd77daf62db3ad378632870d2363ffc6d3001590cb190b9a157a7d960a28791055f3f7d4276228985c8cad79820ab0afa6eb1632d8555303d22f2a4a89d50a0dbc18f682de5ace934560a2d271a1b97d9ef40fd74dd84cba686e3bbb31d943fe93fc41847059942ef9d5b685e458b0e936557aceb8c1f46a18f10f6837413cba6fddc89572e7ec0ceccfe5f3a97f3d7a5c7ba66ebf64371c4b222dbb4e63191e9388fc497681ce071fc2bb156ac9bbad29b99e9628cb07139059d411e7b69c1b111e6629cfab9a25b0633ac44bd030c62"
}
curl --request GET \
--get "https://id.stage.odinn.cloud/api/v1/check-auth" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" {
"data": true
}
Требуемые разрешения: users:create
curl --request POST \
"https://id.stage.odinn.cloud/api/v1/users" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"tgtpfcz\",
\"username\": \"fzpmaqkinyhaxolhemgidxhns\",
\"password\": \"3\\\"T$spv{uEzK\\/QRtR[\",
\"phone\": \"1494540366\",
\"email\": \"ilene08@example.net\",
\"roles\": [
\"aliquam\"
]
}"
{
"id": "00000000-0000-4000-8001-000000000006",
"name": "Test Executor 3",
"username": "executor3",
"email": "almaximal+executor3@ya.ru",
"phone": null,
"email_verified_at": null,
"deleted_at": null,
"created_at": "2025-02-06T10:34:15.000000Z",
"updated_at": "2025-02-06T10:34:15.000000Z",
"roles": [
{
"id": "9e257a75-1c86-468e-b95c-c4b557cbf440",
"code": "executor",
"name": "Исполнитель",
"params": null,
"notes": null,
"author_id": null,
"created_at": "2025-02-06T10:34:14.000000Z",
"updated_at": "2025-02-06T10:34:14.000000Z"
}
]
}
Требуемые разрешения: users:list
curl --request POST \
"https://id.stage.odinn.cloud/api/v1/users/bulk-read" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"ids\": [
\"4310bbb5-1ccf-3612-a1c2-21c39f1e8a14\"
]
}"
[
{
"id": "00000000-0000-4000-8001-000000000011",
"name": "Test Admin 2",
"username": "admintest2",
"email": "almaximal+admin2@ya.ru",
"phone": null,
"email_verified_at": null,
"deleted_at": null,
"created_at": "2025-02-06T10:34:15.000000Z",
"updated_at": "2025-02-06T10:34:15.000000Z",
"roles": [
{
"id": "9e257a75-2de3-4607-99db-91cf7c73850f",
"code": "admin",
"name": "Админ",
"params": null,
"notes": null,
"author_id": null,
"created_at": "2025-02-06T10:34:14.000000Z",
"updated_at": "2025-02-06T10:34:14.000000Z"
}
]
},
{
"id": "00000000-0000-4000-8001-000000000002",
"name": "Test Admin",
"username": "admin",
"email": "almaximal+admin@ya.ru",
"phone": null,
"email_verified_at": null,
"deleted_at": null,
"created_at": "2025-02-06T10:34:15.000000Z",
"updated_at": "2025-02-06T10:34:15.000000Z",
"roles": [
{
"id": "9e257a75-2de3-4607-99db-91cf7c73850f",
"code": "admin",
"name": "Админ",
"params": null,
"notes": null,
"author_id": null,
"created_at": "2025-02-06T10:34:14.000000Z",
"updated_at": "2025-02-06T10:34:14.000000Z"
}
]
}
]
Требуемые разрешения: users:list
Код роли, в которой искать пользователя (код полностью).
Отфильтровать имя или юзернейм (подстрока).
Отфильтровать по доступу (user:auth, roles:list).
Номер страницы.
Количество элементов, возвращаемых на странице. По умолчанию 50.
curl --request GET \
--get "https://id.stage.odinn.cloud/api/v1/users?page=1&page-size=50" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" {
"current_page": 1,
"data": [
{
"id": "00000000-0000-4000-8001-000000000002",
"name": "Test Admin",
"username": "admin",
"email": "almaximal+admin@ya.ru",
"phone": null,
"email_verified_at": null,
"deleted_at": null,
"created_at": "2025-02-06T10:34:15.000000Z",
"updated_at": "2025-02-06T10:34:15.000000Z",
"roles": [
{
"id": "9e257a75-2de3-4607-99db-91cf7c73850f",
"code": "admin",
"name": "Админ",
"params": null,
"notes": null,
"author_id": null,
"created_at": "2025-02-06T10:34:14.000000Z",
"updated_at": "2025-02-06T10:34:14.000000Z"
}
]
},
{
"id": "00000000-0000-4000-8001-000000000003",
"name": "Test Employee",
"username": "employee",
"email": "almaximal+employee@ya.ru",
"phone": null,
"email_verified_at": null,
"deleted_at": null,
"created_at": "2025-02-06T10:34:15.000000Z",
"updated_at": "2025-02-06T10:34:15.000000Z",
"roles": [
{
"id": "9e257a75-2853-40be-9934-9de8f10d524f",
"code": "master",
"name": "Мастер",
"params": null,
"notes": null,
"author_id": null,
"created_at": "2025-02-06T10:34:14.000000Z",
"updated_at": "2025-02-06T10:34:14.000000Z"
}
]
},
{
"id": "00000000-0000-4000-8001-000000000004",
"name": "Test Executor 1",
"username": "executor1",
"email": "almaximal+executor1@ya.ru",
"phone": null,
"email_verified_at": null,
"deleted_at": null,
"created_at": "2025-02-06T10:34:15.000000Z",
"updated_at": "2025-02-06T10:34:15.000000Z",
"roles": [
{
"id": "9e257a75-1c86-468e-b95c-c4b557cbf440",
"code": "executor",
"name": "Исполнитель",
"params": null,
"notes": null,
"author_id": null,
"created_at": "2025-02-06T10:34:14.000000Z",
"updated_at": "2025-02-06T10:34:14.000000Z"
}
]
}
],
"first_page_url": "http://app_users:8080/api/v1/users?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "http://app_users:8080/api/v1/users?page=1",
"links": [
{
"url": null,
"label": "« Назад",
"active": false
},
{
"url": "http://app_users:8080/api/v1/users?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Вперёд »",
"active": false
}
],
"next_page_url": null,
"path": "http://app_users:8080/api/v1/users",
"per_page": 50,
"prev_page_url": null,
"to": 3,
"total": 3
}
Получить данные о текущем пользователе
curl --request GET \
--get "https://id.stage.odinn.cloud/api/v1/users/current" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" {
"id": "00000000-0000-4000-8001-000000000006",
"name": "Test Executor 3",
"username": "executor3",
"email": "almaximal+executor3@ya.ru",
"phone": null,
"email_verified_at": null,
"deleted_at": null,
"created_at": "2025-02-06T10:34:15.000000Z",
"updated_at": "2025-02-06T10:34:15.000000Z",
"roles": [
{
"id": "9e257a75-1c86-468e-b95c-c4b557cbf440",
"code": "executor",
"name": "Исполнитель",
"params": null,
"notes": null,
"author_id": null,
"created_at": "2025-02-06T10:34:14.000000Z",
"updated_at": "2025-02-06T10:34:14.000000Z"
}
]
}
Получить разрешения пользователя в виде массива кодов
curl --request GET \
--get "https://id.stage.odinn.cloud/api/v1/users/current/permissions" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" Требуемые разрешения: users:get
Идентификатор (UUID)
curl --request GET \
--get "https://id.stage.odinn.cloud/api/v1/users/ca40ffe7-bbaa-3f3a-8f6f-25f25ebcdfb3" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" [
{
"id": "00000000-0000-4000-8001-000000000006",
"name": "Test Executor 3",
"username": "executor3",
"email": "almaximal+executor3@ya.ru",
"phone": null,
"email_verified_at": null,
"deleted_at": null,
"created_at": "2025-02-06T10:34:15.000000Z",
"updated_at": "2025-02-06T10:34:15.000000Z",
"roles": [
{
"id": "9e257a75-1c86-468e-b95c-c4b557cbf440",
"code": "executor",
"name": "Исполнитель",
"params": null,
"notes": null,
"author_id": null,
"created_at": "2025-02-06T10:34:14.000000Z",
"updated_at": "2025-02-06T10:34:14.000000Z"
}
]
}
]
Требуемые разрешения: users:update
Идентификатор (UUID)
curl --request PUT \
"https://id.stage.odinn.cloud/api/v1/users/5c3eb033-697b-3b97-aaaf-7003c7f68ec4" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"xtykqghvbnvsbeais\",
\"username\": \"egmmjdsxfjjvljl\",
\"password\": \"2,@Q|:\",
\"phone\": \"8653199207\",
\"email\": \"hipolito.rolfson@example.net\",
\"roles\": [
\"quia\"
]
}"
{
"id": "00000000-0000-4000-8001-000000000006",
"name": "Test Executor 3",
"username": "executor3",
"email": "almaximal+executor3@ya.ru",
"phone": null,
"email_verified_at": null,
"deleted_at": null,
"created_at": "2025-02-06T10:34:15.000000Z",
"updated_at": "2025-02-06T10:34:15.000000Z",
"roles": [
{
"id": "9e257a75-1c86-468e-b95c-c4b557cbf440",
"code": "executor",
"name": "Исполнитель",
"params": null,
"notes": null,
"author_id": null,
"created_at": "2025-02-06T10:34:14.000000Z",
"updated_at": "2025-02-06T10:34:14.000000Z"
}
]
}
Требуемые разрешения: users:update
Идентификатор (UUID)
curl --request PUT \
"https://id.stage.odinn.cloud/api/v1/users/6add1290-64ff-3ab7-8a1e-0310171b19ca/roles" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"roles\": [
\"mjgsjret\"
]
}"
{
"id": "00000000-0000-4000-8001-000000000006",
"name": "Test Executor 3",
"username": "executor3",
"email": "almaximal+executor3@ya.ru",
"phone": null,
"email_verified_at": null,
"deleted_at": null,
"created_at": "2025-02-06T10:34:15.000000Z",
"updated_at": "2025-02-06T10:34:15.000000Z",
"roles": [
{
"id": "9e257a75-1c86-468e-b95c-c4b557cbf440",
"code": "executor",
"name": "Исполнитель",
"params": null,
"notes": null,
"author_id": null,
"created_at": "2025-02-06T10:34:14.000000Z",
"updated_at": "2025-02-06T10:34:14.000000Z"
}
]
}
Требуемые разрешения: roles:list
Номер страницы.
Количество элементов, возвращаемых на странице. По умолчанию 50.
curl --request GET \
--get "https://id.stage.odinn.cloud/api/v1/roles?page=1&page-size=50" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" {
"current_page": 1,
"data": [
{
"id": "9e257a75-2853-40be-9934-9de8f10d524f",
"code": "master",
"name": "Мастер",
"params": null,
"notes": null,
"author_id": null,
"created_at": "2025-02-06T10:34:14.000000Z",
"updated_at": "2025-02-06T10:34:14.000000Z"
},
{
"id": "9e257a75-2de3-4607-99db-91cf7c73850f",
"code": "admin",
"name": "Админ",
"params": null,
"notes": null,
"author_id": null,
"created_at": "2025-02-06T10:34:14.000000Z",
"updated_at": "2025-02-06T10:34:14.000000Z"
}
],
"first_page_url": "http://app_users:8080/api/v1/roles?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "http://app_users:8080/api/v1/roles?page=1",
"links": [
{
"url": null,
"label": "« Назад",
"active": false
},
{
"url": "http://app_users:8080/api/v1/roles?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Вперёд »",
"active": false
}
],
"next_page_url": null,
"path": "http://app_users:8080/api/v1/roles",
"per_page": 50,
"prev_page_url": null,
"to": 2,
"total": 2
}
Требуемые разрешения: roles:create
curl --request POST \
"https://id.stage.odinn.cloud/api/v1/roles" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"code\": \"pypldtwcyvpqx\",
\"name\": \"sebyhq\",
\"notes\": \"igxfjbgdueggyyylcrkzqiu\",
\"permissions\": [
\"clrxsknzqiagb\"
]
}"
{
"id": "9e257a75-2853-40be-9934-9de8f10d524f",
"code": "master",
"name": "Мастер",
"params": null,
"notes": null,
"author_id": null,
"created_at": "2025-02-06T10:34:14.000000Z",
"updated_at": "2025-02-06T10:34:14.000000Z",
"permissions": [
{
"id": "00000000-0000-0000-0004-000000000001",
"code": "users:list",
"verb": "просматривать всех пользователей",
"title": "Просмотр всех пользователей",
"params": null,
"notes": null,
"author_id": null,
"created_at": "2025-02-06T10:34:14.000000Z",
"updated_at": null
},
{
"id": "00000000-0000-0000-0004-000000000002",
"code": "users:create",
"verb": "создавать пользователей",
"title": "Создание пользователей",
"params": null,
"notes": null,
"author_id": null,
"created_at": "2025-02-06T10:34:14.000000Z",
"updated_at": null
}
]
}
Требуемые разрешения: roles:list
Идентификатор (UUID)
curl --request GET \
--get "https://id.stage.odinn.cloud/api/v1/roles/05ec63e3-d72b-3710-a1e8-21c1c98856b0" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" {
"id": "9e257a75-2853-40be-9934-9de8f10d524f",
"code": "master",
"name": "Мастер",
"params": null,
"notes": null,
"author_id": null,
"created_at": "2025-02-06T10:34:14.000000Z",
"updated_at": "2025-02-06T10:34:14.000000Z",
"permissions": [
{
"id": "00000000-0000-0000-0004-000000000001",
"code": "users:list",
"verb": "просматривать всех пользователей",
"title": "Просмотр всех пользователей",
"params": null,
"notes": null,
"author_id": null,
"created_at": "2025-02-06T10:34:14.000000Z",
"updated_at": null
},
{
"id": "00000000-0000-0000-0004-000000000002",
"code": "users:create",
"verb": "создавать пользователей",
"title": "Создание пользователей",
"params": null,
"notes": null,
"author_id": null,
"created_at": "2025-02-06T10:34:14.000000Z",
"updated_at": null
}
]
}
Нельзя обновить системные роли: root, auth.
Требуемые разрешения: roles:update
Идентификатор (UUID)
curl --request PUT \
"https://id.stage.odinn.cloud/api/v1/roles/a45bdd26-d9ce-3699-aec6-a7a1fb3040f4" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"code\": \"oeb\",
\"name\": \"oehaudijcahomwjosi\",
\"notes\": \"ihtzcidacpsqvebrq\",
\"permissions\": [
\"tfhjxnmmpttbnvpmtcd\"
]
}"
{
"id": "9e257a75-2853-40be-9934-9de8f10d524f",
"code": "master",
"name": "Мастер",
"params": null,
"notes": null,
"author_id": null,
"created_at": "2025-02-06T10:34:14.000000Z",
"updated_at": "2025-02-06T10:34:14.000000Z",
"permissions": [
{
"id": "00000000-0000-0000-0004-000000000001",
"code": "users:list",
"verb": "просматривать всех пользователей",
"title": "Просмотр всех пользователей",
"params": null,
"notes": null,
"author_id": null,
"created_at": "2025-02-06T10:34:14.000000Z",
"updated_at": null
},
{
"id": "00000000-0000-0000-0004-000000000002",
"code": "users:create",
"verb": "создавать пользователей",
"title": "Создание пользователей",
"params": null,
"notes": null,
"author_id": null,
"created_at": "2025-02-06T10:34:14.000000Z",
"updated_at": null
}
]
}
Нельзя удалить системные роли: root, auth.
Требуемые разрешения: roles:delete
Идентификатор (UUID)
curl --request DELETE \
"https://id.stage.odinn.cloud/api/v1/roles/d051d199-0757-36e1-8192-5b60ace672e7" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" {
"data": true
}
Массив объектов разрешений.
Требуемые разрешения: permissions:list
Номер страницы.
Количество элементов, возвращаемых на странице. По умолчанию 50.
curl --request GET \
--get "https://id.stage.odinn.cloud/api/v1/permissions?page=1&page-size=50" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" Требуемые разрешения: permissions:create
curl --request POST \
"https://id.stage.odinn.cloud/api/v1/permissions" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"code\": \"wfjupitogsgrruwekfbsft\",
\"verb\": \"gryiicxsjgueup\",
\"title\": \"ctfjzjkfqnlmklwedchrsh\",
\"notes\": \"znuovkeneqaeihir\"
}"
Требуемые разрешения: permissions:list
Идентификатор (UUID)
curl --request GET \
--get "https://id.stage.odinn.cloud/api/v1/permissions/8a039346-877f-3d0c-97ec-92907461f247" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" Нельзя обновить системные разрешения: user:, users:, roles:, permissions:.
Требуемые разрешения: permissions:update
Идентификатор (UUID)
curl --request PUT \
"https://id.stage.odinn.cloud/api/v1/permissions/6d1febf8-aaa5-337e-bf74-767babea71ad" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"code\": \"mwtigmouynfurpgxwt\",
\"verb\": \"tjgfoznnlnntcgbr\",
\"title\": \"hooteviipt\",
\"notes\": \"kijilz\"
}"
Нельзя удалить системные разрешения: user:, users:, roles:, permissions:.
Требуемые разрешения: permissions:delete
Идентификатор (UUID)
curl --request DELETE \
"https://id.stage.odinn.cloud/api/v1/permissions/4da98470-b353-35fb-a262-185a70fff052" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" Взаимодействие от имени клиента (сервиса)
access_token является JWT.
Пример payload:
{
"aud": "9c876e62-6a44-455f-b33d-5dbe72475274",
"jti": "8aa424247a29485b66af9670c7e6532b9f85504745bac4e74a653d78d6aaa4e4f9d938e8278fdc64",
"iat": 1739180144.815972, // issued at time
"nbf": 1739180144.815974,
"exp": 1740389744.806619, // expire time
"sub": "", // user_id здесь нет, т.к. это ключ для действий от имени сервиса
"scopes": []
}
curl --request POST \
"https://id.stage.odinn.cloud/api/v1/client/login" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"client_id\": \"241b7515-1175-3f66-97e8-7b2d3629af1f\",
\"client_secret\": \"weepuxgznnw\"
}"
{
"token_type": "Bearer",
"expires_in": 1209600,
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiI5Yzg3NmU2Mi02YTQ0LTQ1NWYtYjMzZC01ZGJlNzI0NzUyNzQiLCJqdGkiOiI4YWE0MjQyNDdhMjk0ODViNjZhZjk2NzBjN2U2NTMyYjlmODU1MDQ3NDViYWM0ZTc0YTY1M2Q3OGQ2YWFhNGU0ZjlkOTM4ZTgyNzhmZGM2NCIsImlhdCI6MTczOTE4MzU1MC45NjU0NzQsIm5iZiI6MTczOTE4MzU1MC45NjU0NzYsImV4cCI6MTc0MDM5MzE1MC45NjEwOCwic3ViIjoiIiwic2NvcGVzIjpbXX0.iaxFl4DYXWDJQIlfJrLUSmaJf-OYKCW2sabUU8qWN9rBK0gFZY-sUt_IzlLdbIMWX_faMpxYcuwasVRMjyLGowIYjdyv4YE2hgz83Wa-bnIwtuSHGlgEBQZR6QrSXdGoFZe5v5ThCWJc6WqGsOlgzyXjuZhrFs-eOuW7f5irtV3nLiswbFEMYlBIWgNMqzmZC7g44CoFMuOWDl-BsAricutmN6ko5jE_kMyH95UVHp1RnCeZxkIaaWzVsvc7sxtSAJSfGXy0wfaszzbrH2lRz3OMyL4Zqylk4K4URKF6PMK7fytSBbyg-TTnQLbfTnZBr6PcHCgbRQL0o4S7Bko739MbRbE0mFWnv9kA8bqwHobjL1PP4zE1KXPJB38L60c0YG3xkLXfq-WOLMfwcs80uT8lXI84Lgh_VblPEsF9sfaOH0_J3lHFYcc3nMOdDGNvL9LFwCDU5ehoQpFPEEB6Ky6XAABVCPZ86zTROkJcTKhdf8arKcgkEugmvrrIm3L6OkVVLNTBwSWNNvUouMxZ3jd0wIYG4zHSbzA4g8QXzCuBb_k9T6sZjj4ECE0UBj2n6EH7R73_00ow_5wsRTbObFUJYoqrN02an36mxSPN5I07nOEJC1PWpoTA7mlOeREM4ug3J0i11g7wMuC1iNIqEYJZCxR01Vk2hr0j8ORUwNc"
}
curl --request GET \
--get "https://id.stage.odinn.cloud/api/v1/client/check-auth" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" {
"data": true
}
curl --request POST \
"https://id.stage.odinn.cloud/api/v1/client/users" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"ch\",
\"username\": \"rizuxfvsctcfgd\",
\"password\": \"j:\'`zWAfI4f\",
\"password_hash\": \"xwoiomobgavpciemchftpzjdhtkoucvyvybkhrpssykqkxfgirjdswdxdlwzprachzksbutbhapstkksvvltpcux\",
\"phone\": \"11840201796\",
\"email\": \"laura.auer@example.net\",
\"roles\": [
\"reiciendis\"
]
}"
[
{
"id": "9e2d965e-2663-43d8-8316-c585f98d8748",
"name": "lcezdywovqahbotk",
"username": "mmhqxvvejbcgzvohwghbv",
"email": "lexie38@example.org",
"phone": "7437899606",
"email_verified_at": null,
"deleted_at": null,
"created_at": "2025-02-10T11:18:54.000000Z",
"updated_at": "2025-02-10T11:18:54.000000Z",
"roles": [
{
"id": "9e257a75-2de3-4607-99db-91cf7c73850f",
"code": "admin",
"name": "Админ",
"params": null,
"notes": null,
"author_id": null,
"created_at": "2025-02-06T10:34:14.000000Z",
"updated_at": "2025-02-06T10:34:14.000000Z"
}
]
}
]
Получить список пользователей с возможностью фильтрации по времени обновления данных. Полезно для синхронизации обновлений данных пользователей от других сервисов.
Unix timestamp. Если задано - вернуться пользователи с временем обновления после этого значения. Значение поля value должно быть не меньше 1.
Номер страницы.
Количество элементов, возвращаемых на странице. По умолчанию 50.
curl --request GET \
--get "https://id.stage.odinn.cloud/api/v1/client/users?page=1&page-size=50" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" cache-control
: no-cache, private
content-type
: application/json
access-control-allow-origin
: *
{
"message": "Unauthenticated."
}
Идентификатор (UUID)
curl --request GET \
--get "https://id.stage.odinn.cloud/api/v1/client/users/9e0046c2-d3ff-3a25-8339-e0b58deaa5da" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" [
{
"id": "9e2d965e-2663-43d8-8316-c585f98d8748",
"name": "lcezdywovqahbotk",
"username": "mmhqxvvejbcgzvohwghbv",
"email": "lexie38@example.org",
"phone": "7437899606",
"email_verified_at": null,
"deleted_at": null,
"created_at": "2025-02-10T11:18:54.000000Z",
"updated_at": "2025-02-10T11:18:54.000000Z",
"roles": [
{
"id": "9e257a75-2de3-4607-99db-91cf7c73850f",
"code": "admin",
"name": "Админ",
"params": null,
"notes": null,
"author_id": null,
"created_at": "2025-02-06T10:34:14.000000Z",
"updated_at": "2025-02-06T10:34:14.000000Z"
}
]
}
]
Идентификатор (UUID)
curl --request PUT \
"https://id.stage.odinn.cloud/api/v1/client/users/19558a26-983e-3bd9-a594-c7affd02a411" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"aeanwtygw\",
\"username\": \"labjuljotggfireywacfoj\",
\"password\": \":KNFqy^#*2e(_xJkf:Wv\",
\"password_hash\": \"cfaonfycprplvomlghwnxykdbdigpqvztnodpyuhwmraptwdqwngzrjpjoaiqtnmrgdqxjpofd\",
\"phone\": \"46527938053\",
\"email\": \"gbogisich@example.org\",
\"roles\": [
\"sequi\"
]
}"
[
{
"id": "9e2d965e-2663-43d8-8316-c585f98d8748",
"name": "lcezdywovqahbotk",
"username": "mmhqxvvejbcgzvohwghbv",
"email": "lexie38@example.org",
"phone": "7437899606",
"email_verified_at": null,
"deleted_at": null,
"created_at": "2025-02-10T11:18:54.000000Z",
"updated_at": "2025-02-10T11:18:54.000000Z",
"roles": [
{
"id": "9e257a75-2de3-4607-99db-91cf7c73850f",
"code": "admin",
"name": "Админ",
"params": null,
"notes": null,
"author_id": null,
"created_at": "2025-02-06T10:34:14.000000Z",
"updated_at": "2025-02-06T10:34:14.000000Z"
}
]
}
]
Получить разрешения пользователя в виде массива кодов
Идентификатор (UUID)
curl --request GET \
--get "https://id.stage.odinn.cloud/api/v1/client/users/774c3502-7cc5-35e7-9444-93eeea05b38d/permissions" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" Номер страницы.
Количество элементов, возвращаемых на странице. По умолчанию 50.
curl --request GET \
--get "https://id.stage.odinn.cloud/api/v1/client/roles?page=1&page-size=50" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" {
"current_page": 1,
"data": [
{
"id": "9e257a75-2853-40be-9934-9de8f10d524f",
"code": "master",
"name": "Мастер",
"params": null,
"notes": null,
"author_id": null,
"created_at": "2025-02-06T10:34:14.000000Z",
"updated_at": "2025-02-06T10:34:14.000000Z"
},
{
"id": "9e257a75-2de3-4607-99db-91cf7c73850f",
"code": "admin",
"name": "Админ",
"params": null,
"notes": null,
"author_id": null,
"created_at": "2025-02-06T10:34:14.000000Z",
"updated_at": "2025-02-06T10:34:14.000000Z"
}
],
"first_page_url": "http://app_users:8080/api/v1/roles?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "http://app_users:8080/api/v1/roles?page=1",
"links": [
{
"url": null,
"label": "« Назад",
"active": false
},
{
"url": "http://app_users:8080/api/v1/roles?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Вперёд »",
"active": false
}
],
"next_page_url": null,
"path": "http://app_users:8080/api/v1/roles",
"per_page": 50,
"prev_page_url": null,
"to": 2,
"total": 2
}
curl --request POST \
"https://id.stage.odinn.cloud/api/v1/client/roles" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"code\": \"ujruerzlnrr\",
\"name\": \"sjeqyfmkdtaindwfur\",
\"notes\": \"cgpzasjbtugy\",
\"permissions\": [
\"yxtulvrzhjcgvtym\"
]
}"
{
"id": "9e257a75-2853-40be-9934-9de8f10d524f",
"code": "master",
"name": "Мастер",
"params": null,
"notes": null,
"author_id": null,
"created_at": "2025-02-06T10:34:14.000000Z",
"updated_at": "2025-02-06T10:34:14.000000Z",
"permissions": [
{
"id": "00000000-0000-0000-0004-000000000001",
"code": "users:list",
"verb": "просматривать всех пользователей",
"title": "Просмотр всех пользователей",
"params": null,
"notes": null,
"author_id": null,
"created_at": "2025-02-06T10:34:14.000000Z",
"updated_at": null
},
{
"id": "00000000-0000-0000-0004-000000000002",
"code": "users:create",
"verb": "создавать пользователей",
"title": "Создание пользователей",
"params": null,
"notes": null,
"author_id": null,
"created_at": "2025-02-06T10:34:14.000000Z",
"updated_at": null
}
]
}
Идентификатор (UUID)
curl --request GET \
--get "https://id.stage.odinn.cloud/api/v1/client/roles/98ea0013-74c5-3527-9a59-cfaed67356f6" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" {
"id": "9e257a75-2853-40be-9934-9de8f10d524f",
"code": "master",
"name": "Мастер",
"params": null,
"notes": null,
"author_id": null,
"created_at": "2025-02-06T10:34:14.000000Z",
"updated_at": "2025-02-06T10:34:14.000000Z",
"permissions": [
{
"id": "00000000-0000-0000-0004-000000000001",
"code": "users:list",
"verb": "просматривать всех пользователей",
"title": "Просмотр всех пользователей",
"params": null,
"notes": null,
"author_id": null,
"created_at": "2025-02-06T10:34:14.000000Z",
"updated_at": null
},
{
"id": "00000000-0000-0000-0004-000000000002",
"code": "users:create",
"verb": "создавать пользователей",
"title": "Создание пользователей",
"params": null,
"notes": null,
"author_id": null,
"created_at": "2025-02-06T10:34:14.000000Z",
"updated_at": null
}
]
}
Нельзя обновить системные роли: root, auth.
Идентификатор (UUID)
curl --request PUT \
"https://id.stage.odinn.cloud/api/v1/client/roles/e83802a4-05e5-3410-9a91-fa466337ee45" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"code\": \"nllubmtjvdpqrps\",
\"name\": \"rxjpysyoyuflnvqcq\",
\"notes\": \"boprrgzb\",
\"permissions\": [
\"rwk\"
]
}"
{
"id": "9e257a75-2853-40be-9934-9de8f10d524f",
"code": "master",
"name": "Мастер",
"params": null,
"notes": null,
"author_id": null,
"created_at": "2025-02-06T10:34:14.000000Z",
"updated_at": "2025-02-06T10:34:14.000000Z",
"permissions": [
{
"id": "00000000-0000-0000-0004-000000000001",
"code": "users:list",
"verb": "просматривать всех пользователей",
"title": "Просмотр всех пользователей",
"params": null,
"notes": null,
"author_id": null,
"created_at": "2025-02-06T10:34:14.000000Z",
"updated_at": null
},
{
"id": "00000000-0000-0000-0004-000000000002",
"code": "users:create",
"verb": "создавать пользователей",
"title": "Создание пользователей",
"params": null,
"notes": null,
"author_id": null,
"created_at": "2025-02-06T10:34:14.000000Z",
"updated_at": null
}
]
}
Нельзя удалить системные роли: root, auth.
Идентификатор (UUID)
curl --request DELETE \
"https://id.stage.odinn.cloud/api/v1/client/roles/fe3346b8-59ca-3d3d-a7b4-2017afb6125f" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" {
"data": true
}