> ## Documentation Index
> Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Add a statement to the IAM guardrail

> Adds one statement to the organization's guardrail. A statement has an effect, `allow` unless it says `deny`, and a list of actions: exact action IDs, wildcards such as `number.*`, or `*`. Every entry must match the catalog. Start with an allow of `*` and add denies.

While the organization has enabled IAM, every request in it must pass the guardrail, the organization owner's included: a guardrail statement must allow the request's action, and none may deny it. The seven actions a signed-in user always keeps are exempt, except for the owner. An organization without statements has no guardrail. The guardrail only takes away: it never allows more than roles and API key scopes allow. A request sent into a managed organization with `X-Managed-Account-Id` must pass the managed organization's guardrail instead of the sender's own, when the managed organization has enabled IAM, whether or not the sender's organization has. The sender's own guardrail still decides `managed_account.impersonate`.

A change that would leave the guardrail not allowing `iam_guardrail.update` answers `422`, so the first statement must allow it, for example with an allow of `*`.

Its action is `iam_guardrail.update`.



## OpenAPI

````yaml /openapi/source/external/iam/iam.json post /iam/guardrail/statements
openapi: 3.1.0
info:
  title: Telnyx API
  version: 1.0.0
  description: >-
    Identity and Access Management (IAM) decides what the users and service
    accounts of an organization may do. The organization writes roles of allow
    and deny statements over actions, gives the roles to users and service
    accounts with grants, and enables IAM so that the grants decide. This API
    manages roles and their statements, grants, the IAM setting, the
    organization's guardrail, service accounts and their tokens, and the
    organization's API keys and their scopes. It also reads the action catalog,
    explains and simulates decisions, and lists access logs.


    Only the organization owner can call these endpoints. Any other user, and
    any service account token, gets `403`. Each endpoint declares an action,
    named in its description. Once IAM is enabled, a scope on one of the owner's
    API keys narrows that key, so the key can call an endpoint only when its
    scope allows the endpoint's action.


    See [IAM](https://developers.telnyx.com/docs/iam) for how decisions are
    made.
  contact:
    email: support@telnyx.com
  x-latency-category: interactive
  x-endpoint-cost: light
servers:
  - url: https://api.telnyx.com/v2
    description: Telnyx API v2
security:
  - bearerAuth: []
tags:
  - name: IAM Roles
    description: >-
      Named sets of statements that the organization gives to users and service
      accounts with grants.
  - name: IAM Role Statements
    description: The statements of a role, each allowing or denying a list of actions.
  - name: IAM Grants
    description: Which users and service accounts hold which roles.
  - name: IAM Actions
    description: The catalog of actions that routes declare and statements allow or deny.
  - name: IAM Settings
    description: Whether the organization has enabled IAM.
  - name: IAM Guardrail
    description: >-
      Statements on the whole organization that every request must pass while
      IAM is enabled, the owner's included.
  - name: IAM Service Accounts
    description: Principals for workloads, such as servers, pipelines, and integrations.
  - name: IAM Service Account Tokens
    description: The credentials a service account authenticates with.
  - name: IAM API Keys
    description: The API keys of every user of the organization, the owner's included.
  - name: IAM API Key Scopes
    description: Statements on one API key that narrow what it may do.
  - name: IAM Decisions
    description: >-
      What IAM decides for a principal, explained or simulated without changing
      anything.
  - name: IAM Access Logs
    description: >-
      The requests IAM allowed or denied, with the reasons and the roles behind
      them.
paths:
  /iam/guardrail/statements:
    post:
      tags:
        - IAM Guardrail
      summary: Add a statement to the IAM guardrail
      description: >-
        Adds one statement to the organization's guardrail. A statement has an
        effect, `allow` unless it says `deny`, and a list of actions: exact
        action IDs, wildcards such as `number.*`, or `*`. Every entry must match
        the catalog. Start with an allow of `*` and add denies.


        While the organization has enabled IAM, every request in it must pass
        the guardrail, the organization owner's included: a guardrail statement
        must allow the request's action, and none may deny it. The seven actions
        a signed-in user always keeps are exempt, except for the owner. An
        organization without statements has no guardrail. The guardrail only
        takes away: it never allows more than roles and API key scopes allow. A
        request sent into a managed organization with `X-Managed-Account-Id`
        must pass the managed organization's guardrail instead of the sender's
        own, when the managed organization has enabled IAM, whether or not the
        sender's organization has. The sender's own guardrail still decides
        `managed_account.impersonate`.


        A change that would leave the guardrail not allowing
        `iam_guardrail.update` answers `422`, so the first statement must allow
        it, for example with an allow of `*`.


        Its action is `iam_guardrail.update`.
      operationId: CreateIamGuardrailStatement
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IamGuardrailStatementCreateRequest'
            examples:
              allow_all:
                summary: Allow every action
                value:
                  actions:
                    - '*'
              deny:
                summary: Deny two actions
                value:
                  effect: deny
                  actions:
                    - number.delete
                    - iam_settings.update
      responses:
        '201':
          description: The new guardrail statement.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IamGuardrailStatementResponse'
              example:
                data:
                  id: b7e2d9f4-1a3c-4f6e-8d20-5c9a0e3f7b61
                  organization_id: 6e9d4c3a-2f8b-4a71-9c05-3b8e1f2d7a64
                  effect: deny
                  actions:
                    - number.delete
                    - iam_settings.update
                  record_type: iam_guardrail_statement
                  created_at: '2026-11-26T09:04:37.902615Z'
                  updated_at: '2026-11-26T09:04:37.902615Z'
        '401':
          $ref: '#/components/responses/IamUnauthorized'
        '403':
          description: >-
            The caller is not allowed `iam_guardrail.update`, or the scope of
            the API key does not allow it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IamErrors'
              examples:
                not_permitted:
                  summary: The caller is not allowed the action
                  value:
                    errors:
                      - code: '10010'
                        title: Authorization failed
                        detail: >-
                          You do not have permission to perform the requested
                          action on the specified resource or resources.
                        source:
                          pointer: /
                        meta:
                          url: >-
                            https://developers.telnyx.com/docs/overview/errors/10010
                key_scope:
                  summary: The scope of the API key does not allow the action
                  value:
                    errors:
                      - code: '10010'
                        title: Authorization failed
                        detail: >-
                          the credential's scope does not allow
                          iam_guardrail.update
                        source:
                          pointer: /
                        meta:
                          url: >-
                            https://developers.telnyx.com/docs/overview/errors/10010
        '422':
          description: >-
            An entry matches no action, `actions` is missing or empty, or the
            guardrail would no longer allow `iam_guardrail.update`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IamErrors'
              examples:
                unknown_action:
                  summary: An entry matches no action of the catalog
                  value:
                    errors:
                      - code: '10027'
                        title: Invalid guardrail statement
                        detail: One or more actions provided do not exist.
                        source:
                          pointer: /actions
                        meta:
                          url: >-
                            https://developers.telnyx.com/docs/overview/errors/10027
                locked:
                  summary: >-
                    The change would leave the guardrail not allowing
                    `iam_guardrail.update`
                  value:
                    errors:
                      - code: '10027'
                        title: Invalid guardrail statement
                        detail: must allow iam_guardrail.update
                        source:
                          pointer: /guardrail
                        meta:
                          url: >-
                            https://developers.telnyx.com/docs/overview/errors/10027
components:
  schemas:
    IamGuardrailStatementCreateRequest:
      type: object
      additionalProperties: false
      required:
        - actions
      properties:
        effect:
          type: string
          enum:
            - allow
            - deny
          default: allow
          description: Whether the statement allows or denies its actions.
        actions:
          type: array
          minItems: 1
          items:
            type: string
          description: >-
            Exact action IDs from `GET /v2/iam/actions`, wildcards such as
            `number.*`, which covers every action ID that starts with `number.`,
            or `*`, which covers every action. Every entry must match the
            catalog. Duplicates are removed.
    IamGuardrailStatementResponse:
      type: object
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/IamGuardrailStatement'
    IamErrors:
      type: object
      required:
        - errors
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/IamError'
    IamGuardrailStatement:
      type: object
      required:
        - id
        - organization_id
        - effect
        - actions
        - record_type
        - created_at
        - updated_at
      properties:
        id:
          type: string
          format: uuid
          description: The guardrail statement's ID.
        organization_id:
          type: string
          description: The organization the guardrail belongs to.
        effect:
          type: string
          enum:
            - allow
            - deny
          description: Whether the statement allows or denies its actions.
        actions:
          type: array
          items:
            type: string
          description: Action IDs, wildcards such as `number.*`, or `*`.
        record_type:
          type: string
          enum:
            - iam_guardrail_statement
          description: Identifies the type of the resource.
        created_at:
          type: string
          format: date-time
          description: When the statement was created.
        updated_at:
          type: string
          format: date-time
          description: When the statement was last changed.
    IamError:
      type: object
      required:
        - code
        - title
      properties:
        code:
          type: string
          description: The Telnyx error code.
        title:
          type: string
          description: A short summary of the error.
        detail:
          type: string
          description: What went wrong.
        source:
          type: object
          description: The part of the request that caused the error.
          properties:
            pointer:
              type: string
              description: A JSON pointer to the field that caused the error.
            value:
              description: The value that caused the error.
        meta:
          type: object
          properties:
            url:
              type: string
              format: uri
              description: The documentation page for the error code.
            denied_role_ids:
              type: array
              items:
                type: string
                format: uuid
              description: >-
                The granted roles whose deny statements refused the request,
                when a role refused it.
  responses:
    IamUnauthorized:
      description: The request has no valid credential.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/IamErrors'
          example:
            errors:
              - code: '10009'
                title: Authentication failed
                detail: Could not find any usable credentials in the request.
                source:
                  pointer: /
                meta:
                  url: https://developers.telnyx.com/docs/overview/errors/10009
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````