`POST /v1/orgs/{org}/policies`.
const url = 'https://api.updawg.net/v1/orgs/example/policies';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"yaml":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.updawg.net/v1/orgs/example/policies \ --header 'Content-Type: application/json' \ --data '{ "yaml": "example" }'Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Organization slug.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Option so that a missing field produces this API’s own 400 rather
than axum’s plain-text 422 — see DAWG-246 and the note in
routes::proposals::reject.
Example generated
{ "yaml": "example"}Responses
Section titled “Responses”Created at version 1.
object
Which version is in force. Named version rather than
current_version because from outside there is only one that matters,
and ?version= takes this same number.
The version this body carries, which differs from version when an
older one was asked for. Both are here on purpose: a portal showing
version 2 of a policy on version 5 needs to know it is looking at
history rather than at the policy.
Byte for byte what somebody wrote. The compiled form is derived from it and is not handed back — there is one source of truth for what a policy says and it is the text.
Example
{ "managed_by": "terraform"}The document does not compile, or names a group this organization does not have.
object
Example generated
{ "detail": "example", "status": 1, "title": "example", "type": "example"}No session.
object
Example generated
{ "detail": "example", "status": 1, "title": "example", "type": "example"}Not permitted for this role. Or a plan that does not include a feature it uses: plan-required.
object
Example generated
{ "detail": "example", "status": 1, "title": "example", "type": "example"}No such organization, or not yours.
object
Example generated
{ "detail": "example", "status": 1, "title": "example", "type": "example"}A live policy already has that name.
object
Example generated
{ "detail": "example", "status": 1, "title": "example", "type": "example"}The organization’s data is in another region (wrong-region, DAWG-159). detail names that region’s API; send the request there.
object
Example generated
{ "detail": "example", "status": 1, "title": "example", "type": "example"}Over the organization’s request limit. Retry-After says when to try again; RateLimit-Limit is the burst.
object
Example generated
{ "detail": "example", "status": 1, "title": "example", "type": "example"}