Skip to content
Anlyon
Esc
↑↓navigate↵open⌘Jpreview

Create an impact limit

Cap money (one currency, integer minor units), resource_mutations, or a workspace-declared unit such as emails for the whole environment, optionally narrowed to one action and/or a resource prefix, per day, month or total. Shared by every agent, session and key: none of them is part of a limit’s identity. A limit in a declared unit applies to actions that declare an impact in that unit. A declared action’s resource key is http:<host><path>, so resourcePrefix can scope a limit to a path prefix. Needs impact-limits:write, which no key receives by default. A console session or an OAuth connection also needs the admin role in the limit’s environment, where a per-environment grant applies.

POST/api/v2/impact-limits
Authorization
AuthorizationBearer token (Anlyon API key) · headerrequired

Workspace API key sent as Authorization: Bearer <key>.

or
better-auth.session_tokenAPI key · cookierequired

Browser session used by dashboard-only operations.

Header parameters
X-Request-Idstring

Optional caller correlation ID. Unsafe or oversized values are replaced.

max length 128
Request body
requiredapplication/json
namestringrequired
min length 1 · max length 120
dimensionstringrequired

money, resource_mutations, or a workspace-declared unit such as emails. A declared unit caps the actions that declare an impact in that unit.

matches ^[a-z][a-z0-9_]{0,31}$
currencystring

Required for money.

matches ^[a-z]{3}$
unitstring

Optional. The currency for money, the dimension name for every other dimension. It is implied by dimension and currency, and refused when it disagrees with them.

matches ^[a-z][a-z0-9_]{0,31}$
actionNamestring | null
min length 1 · max length 100
resourcePrefixstring | null
min length 1 · max length 500
scopestring

end_user: each end user has the whole amount, counted on their own periods ("each user may send 20 emails a day"). A call with no end user counts on the shared allowance. Fixed once created.

default: "environment"
Allowed:environmentend_user
periodstringrequired
Allowed:daymonthtotal
amountintegerrequired
min 0
Responses
201

Impact limit returned.

successbooleanrequired
Allowed:true
dataImpactLimitrequired
Show properties
idstringrequired
namestringrequired
dimensionstringrequired

money, resource_mutations, or a workspace-declared unit such as emails.

matches ^[a-z][a-z0-9_]{0,31}$
currencystring | nullrequired
unitstringrequired

What the amounts count. The currency for money, the dimension name for every other dimension.

scopeobjectrequired
Show properties
environmentIdstring<uuid>required
actionNamestring | nullrequired
resourcePrefixstring | nullrequired
kindstringrequired

environment: one allowance shared by every call. end_user: each end user has the whole amount; the figures are then those of the end user named by ?endUserId=, or of calls with no end user.

Allowed:environmentend_user
periodstringrequired
Allowed:daymonthtotal
limitintegerrequired
min 0
currentPeriodstringrequired
consumedintegerrequired
min 0
reservedintegerrequired
min 0
unknownExposureintegerrequired
min 0
availableintegerrequired
min 0
archivedbooleanrequired
createdAtstring<date-time>required
updatedAtstring<date-time>required
400

Bad Request - Invalid input data

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
fixErrorFix

How to get past this error, for a person or an agent. Present on refusals with a known next step, such as a missing scope or role, a plan or billing limit, a halted environment, or a missing secret, connected account, OAuth app or end-user header. Absent when there is no fix to give. Kept in production responses, unlike details.

Show properties
summarystringrequired

One sentence that says what to do.

commandstring

An exact anlyon CLI command that fixes it. Absent when no command does.

urlstring<uri>

An absolute console link where a person fixes it.

docsstring<uri>

A docs page that explains it.

401

Unauthorized - Invalid or missing API key

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
fixErrorFix

How to get past this error, for a person or an agent. Present on refusals with a known next step, such as a missing scope or role, a plan or billing limit, a halted environment, or a missing secret, connected account, OAuth app or end-user header. Absent when there is no fix to give. Kept in production responses, unlike details.

Show properties
summarystringrequired

One sentence that says what to do.

commandstring

An exact anlyon CLI command that fixes it. Absent when no command does.

urlstring<uri>

An absolute console link where a person fixes it.

docsstring<uri>

A docs page that explains it.

403

Authenticated credential lacks the required scope or workspace access.

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
fixErrorFix

How to get past this error, for a person or an agent. Present on refusals with a known next step, such as a missing scope or role, a plan or billing limit, a halted environment, or a missing secret, connected account, OAuth app or end-user header. Absent when there is no fix to give. Kept in production responses, unlike details.

Show properties
summarystringrequired

One sentence that says what to do.

commandstring

An exact anlyon CLI command that fixes it. Absent when no command does.

urlstring<uri>

An absolute console link where a person fixes it.

docsstring<uri>

A docs page that explains it.

429

Too Many Requests - Rate limit exceeded. A workspace's API requests are limited per minute and per UTC clock hour by plan; Retry-After says when to try again, and an hourly refusal names the limit and when the count resets. Successful responses carry the same limits in X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset (the minute) and X-RateLimit-Limit-Hour, X-RateLimit-Remaining-Hour, X-RateLimit-Reset-Hour (the hour).

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
fixErrorFix

How to get past this error, for a person or an agent. Present on refusals with a known next step, such as a missing scope or role, a plan or billing limit, a halted environment, or a missing secret, connected account, OAuth app or end-user header. Absent when there is no fix to give. Kept in production responses, unlike details.

Show properties
summarystringrequired

One sentence that says what to do.

commandstring

An exact anlyon CLI command that fixes it. Absent when no command does.

urlstring<uri>

An absolute console link where a person fixes it.

docsstring<uri>

A docs page that explains it.

Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X POST 'https://api.anlyon.com/api/v2/impact-limits' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string",
  "dimension": "money",
  "currency": "usd",
  "unit": "usd",
  "actionName": "string",
  "resourcePrefix": "github:acme/fixtures@",
  "scope": "environment",
  "period": "day",
  "amount": 0
}'
Response
{
  "success": true,
  "data": {
    "id": "lim_01JABCDEF",
    "name": "string",
    "dimension": "money",
    "currency": "string",
    "unit": "usd",
    "scope": {
      "environmentId": "19f5cc2e-7657-437a-9268-83cd3d563563",
      "actionName": "string",
      "resourcePrefix": "string",
      "kind": "environment"
    },
    "period": "day",
    "limit": 0,
    "currentPeriod": "month:2026-09",
    "consumed": 0,
    "reserved": 0,
    "unknownExposure": 0,
    "available": 0,
    "archived": true,
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z"
  }
}

Was this page helpful?