Permit.io User Invites API

The User Invites API from Permit.io, for user invites.

GitHub OpenAPI
Pull this API's OpenAPI, operations, scores and pricing into your own code or AI agent with a free APIs.io key — sign in with GitHub, Google or LinkedIn. No form to fill in; signing in shares your email address with us (Privacy).

Operations 6

GET /v2/facts/{proj_id}/{env_id}/user_invites List User Invites #
POST /v2/facts/{proj_id}/{env_id}/user_invites Create User Invite #
GET /v2/facts/{proj_id}/{env_id}/user_invites/{user_invite_id} Get User Invite #
PATCH /v2/facts/{proj_id}/{env_id}/user_invites/{user_invite_id} Update User Invite #
DELETE /v2/facts/{proj_id}/{env_id}/user_invites/{user_invite_id} Delete User Invite #
POST /v2/facts/{proj_id}/{env_id}/user_invites/{user_invite_id}/approve Approve User Invite #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/permitio:permitio-user-invites-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

permitio-user-invites-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Permit.io User Invites API
  description: Authorization as a service
  version: 2.0.0
tags:
- name: User Invites
paths:
  /v2/facts/{proj_id}/{env_id}/user_invites:
    get:
      tags:
      - User Invites
      summary: List User Invites
      operationId: list_user_invites
      security:
      - HTTPBearer: []
      parameters:
      - name: proj_id
        in: path
        required: true
        schema:
          type: string
          description: 'Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug").'
          title: Proj Id
        description: 'Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug").'
        example: my_project
      - name: env_id
        in: path
        required: true
        schema:
          type: string
          description: 'Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug").'
          title: Env Id
        description: 'Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug").'
        example: my_environment
      - name: role
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: optional role filter, will only return invited users with this role.
          title: Role
        description: optional role filter, will only return invited users with this role.
      - name: tenant
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: optional tenant filter, will only return invited users in that tenant.
          title: Tenant
        description: optional tenant filter, will only return invited users in that tenant.
      - name: search
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: optional search, will only return invited users to that email, key or name.
          title: Search
        description: optional search, will only return invited users to that email, key or name.
      - name: page
        in: query
        required: false
        schema:
          type: integer
          minimum: 1
          description: Page number of the results to fetch, starting at 1.
          default: 1
          title: Page
        description: Page number of the results to fetch, starting at 1.
      - name: per_page
        in: query
        required: false
        schema:
          type: integer
          maximum: 100
          minimum: 1
          description: The number of results per page (max 100).
          default: 30
          title: Per Page
        description: The number of results per page (max 100).
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedResult_ElementsUserInviteRead_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
      - User Invites
      summary: Create User Invite
      operationId: create_user_invite
      security:
      - HTTPBearer: []
      parameters:
      - name: proj_id
        in: path
        required: true
        schema:
          type: string
          description: 'Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug").'
          title: Proj Id
        description: 'Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug").'
        example: my_project
      - name: env_id
        in: path
        required: true
        schema:
          type: string
          description: 'Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug").'
          title: Env Id
        description: 'Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug").'
        example: my_environment
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ElementsUserInviteCreate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ElementsUserInviteRead'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v2/facts/{proj_id}/{env_id}/user_invites/{user_invite_id}:
    get:
      tags:
      - User Invites
      summary: Get User Invite
      operationId: get_user_invite
      security:
      - HTTPBearer: []
      parameters:
      - name: user_invite_id
        in: path
        required: true
        schema:
          type: string
          description: 'Either the unique id of the user_invite, or the URL-friendly key of the user_invite (i.e: the "slug").'
          title: User Invite Id
        description: 'Either the unique id of the user_invite, or the URL-friendly key of the user_invite (i.e: the "slug").'
      - name: proj_id
        in: path
        required: true
        schema:
          type: string
          description: 'Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug").'
          title: Proj Id
        description: 'Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug").'
        example: my_project
      - name: env_id
        in: path
        required: true
        schema:
          type: string
          description: 'Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug").'
          title: Env Id
        description: 'Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug").'
        example: my_environment
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ElementsUserInviteRead'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    patch:
      tags:
      - User Invites
      summary: Update User Invite
      operationId: update_user_invite
      security:
      - HTTPBearer: []
      parameters:
      - name: user_invite_id
        in: path
        required: true
        schema:
          type: string
          description: 'Either the unique id of the user_invite, or the URL-friendly key of the user_invite (i.e: the "slug").'
          title: User Invite Id
        description: 'Either the unique id of the user_invite, or the URL-friendly key of the user_invite (i.e: the "slug").'
      - name: proj_id
        in: path
        required: true
        schema:
          type: string
          description: 'Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug").'
          title: Proj Id
        description: 'Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug").'
        example: my_project
      - name: env_id
        in: path
        required: true
        schema:
          type: string
          description: 'Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug").'
          title: Env Id
        description: 'Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug").'
        example: my_environment
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ElementsUserInviteUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ElementsUserInviteRead'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - User Invites
      summary: Delete User Invite
      operationId: delete_user_invite
      security:
      - HTTPBearer: []
      parameters:
      - name: user_invite_id
        in: path
        required: true
        schema:
          type: string
          description: 'Either the unique id of the user_invite, or the URL-friendly key of the user_invite (i.e: the "slug").'
          title: User Invite Id
        description: 'Either the unique id of the user_invite, or the URL-friendly key of the user_invite (i.e: the "slug").'
      - name: proj_id
        in: path
        required: true
        schema:
          type: string
          description: 'Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug").'
          title: Proj Id
        description: 'Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug").'
        example: my_project
      - name: env_id
        in: path
        required: true
        schema:
          type: string
          description: 'Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug").'
          title: Env Id
        description: 'Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug").'
        example: my_environment
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v2/facts/{proj_id}/{env_id}/user_invites/{user_invite_id}/approve:
    post:
      tags:
      - User Invites
      summary: Approve User Invite
      operationId: approve_user_invite
      security:
      - HTTPBearer: []
      parameters:
      - name: user_invite_id
        in: path
        required: true
        schema:
          type: string
          description: 'Either the unique id of the user_invite, or the URL-friendly key of the user_invite (i.e: the "slug").'
          title: User Invite Id
        description: 'Either the unique id of the user_invite, or the URL-friendly key of the user_invite (i.e: the "slug").'
      - name: proj_id
        in: path
        required: true
        schema:
          type: string
          description: 'Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug").'
          title: Proj Id
        description: 'Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug").'
        example: my_project
      - name: env_id
        in: path
        required: true
        schema:
          type: string
          description: 'Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug").'
          title: Env Id
        description: 'Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug").'
        example: my_environment
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ElementsUserInviteApprove'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserRead'
        '400':
          description: The user already approved, the email requested doesn't match the email of the invite, the invite's resource instance does not exist in this environment and tenant, or the invite's role belongs to another resource than the invite's target (tenant or resource instance).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApproveMessage'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    UserResourceInstanceRole:
      properties:
        resource_instance:
          type: string
          title: Resource Instance
          description: The resource instance key which the role is associated with
        resource:
          type: string
          title: Resource
          description: The resource type which the role is associated with
        role:
          type: string
          title: Role
          description: The role key of this resource role
      additionalProperties: false
      type: object
      required:
      - resource_instance
      - resource
      - role
      title: UserResourceInstanceRole
    ElementsUserInviteUpdate:
      properties:
        key:
          anyOf:
          - type: string
            pattern: ^[A-Za-z0-9|@+\-\._]+$
          - type: 'null'
          title: Key
          description: The key of the user that is being invited. When set before approval, only a user JWT carrying this user key can approve the invite through the Elements approve route; when unset, the JWT's verified email must match the invite's.
        status:
          $ref: '#/components/schemas/UserInviteStatus'
          description: The status of the user invite
        email:
          type: string
          format: email
          title: Email
          description: The email of the user that being invited
        first_name:
          anyOf:
          - type: string
          - type: 'null'
          title: First Name
          description: The first name of the user that is being invited
        last_name:
          anyOf:
          - type: string
          - type: 'null'
          title: Last Name
          description: The last name of the user that is being invited
        role_id:
          type: string
          format: uuid
          title: Role Id
          description: The role of the user that is being invited
        tenant_id:
          type: string
          format: uuid
          title: Tenant Id
          description: The tenant id of the user that is being invited
        resource_instance_id:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Resource Instance Id
          description: The resource instance id of the user that is being invited
      additionalProperties: false
      type: object
      required:
      - key
      - status
      - email
      - first_name
      - last_name
      - role_id
      - tenant_id
      - resource_instance_id
      title: ElementsUserInviteUpdate
    ElementsUserInviteCreate:
      properties:
        key:
          anyOf:
          - type: string
            pattern: ^[A-Za-z0-9|@+\-\._]+$
          - type: 'null'
          title: Key
          description: The key of the user that is being invited. When set before approval, only a user JWT carrying this user key can approve the invite through the Elements approve route; when unset, the JWT's verified email must match the invite's.
        status:
          $ref: '#/components/schemas/UserInviteStatus'
          description: The status of the user invite
        email:
          type: string
          format: email
          title: Email
          description: The email of the user that being invited
        first_name:
          anyOf:
          - type: string
          - type: 'null'
          title: First Name
          description: The first name of the user that is being invited
        last_name:
          anyOf:
          - type: string
          - type: 'null'
          title: Last Name
          description: The last name of the user that is being invited
        role_id:
          type: string
          format: uuid
          title: Role Id
          description: The role of the user that is being invited
        tenant_id:
          type: string
          format: uuid
          title: Tenant Id
          description: The tenant id of the user that is being invited
        resource_instance_id:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Resource Instance Id
          description: The resource instance id of the user that is being invited
      additionalProperties: false
      type: object
      required:
      - key
      - status
      - email
      - first_name
      - last_name
      - role_id
      - tenant_id
      - resource_instance_id
      title: ElementsUserInviteCreate
    UserInTenant:
      properties:
        tenant:
          type: string
          title: Tenant
          description: The tenant key which the user is associated with
        roles:
          items:
            type: string
          type: array
          title: Roles
          description: List of roles assigned to the user in that tenant
        status:
          $ref: '#/components/schemas/UserStatus'
          description: Whether the user has signed in or not
        resource_instance_roles:
          items:
            $ref: '#/components/schemas/UserResourceInstanceRole'
          type: array
          title: Resource Instance Roles
          default: []
      additionalProperties: false
      type: object
      required:
      - tenant
      - roles
      - status
      title: UserInTenant
    PaginatedResult_ElementsUserInviteRead_:
      properties:
        data:
          items:
            $ref: '#/components/schemas/ElementsUserInviteRead'
          type: array
          title: Data
          description: List of Elements User Invites
        total_count:
          type: integer
          minimum: 0.0
          title: Total Count
          description: The number of results across all pages.
        page_count:
          type: integer
          minimum: 0.0
          title: Page Count
          description: 'The number of pages at the requested `per_page`: `ceil(total_count / per_page)`. Fetch pages 1 to `page_count` to read every result. It is 0 when there are no results, and on a page past the last one.'
          default: 0
      additionalProperties: false
      type: object
      required:
      - data
      - total_count
      title: PaginatedResult[ElementsUserInviteRead]
    ElementsUserInviteApprove:
      properties:
        email:
          type: string
          format: email
          title: Email
          description: The email of the user that being invited
        key:
          type: string
          pattern: ^[A-Za-z0-9|@+\-\._]+$
          title: Key
          description: The key of the elements user invite
        attributes:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Attributes
          description: The attributes of the user
      additionalProperties: false
      type: object
      required:
      - email
      - key
      - attributes
      title: ElementsUserInviteApprove
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    ElementsUserInviteRead:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: Unique id of the elements_user_invite
        organization_id:
          type: string
          format: uuid
          title: Organization Id
          description: Unique id of the organization that the elements_user_invite belongs to.
        project_id:
          type: string
          format: uuid
          title: Project Id
          description: Unique id of the project that the elements_user_invite belongs to.
        environment_id:
          type: string
          format: uuid
          title: Environment Id
          description: Unique id of the environment that the elements_user_invite belongs to.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Date and time when the elements_user_invite was created (ISO_8601 format).
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: Date and time when the elements_user_invite was last updated/modified (ISO_8601 format).
        key:
          anyOf:
          - type: string
            pattern: ^[A-Za-z0-9|@+\-\._]+$
          - type: 'null'
          title: Key
          description: The key of the user that is being invited. When set before approval, only a user JWT carrying this user key can approve the invite through the Elements approve route; when unset, the JWT's verified email must match the invite's.
        status:
          $ref: '#/components/schemas/UserInviteStatus'
          description: The status of the user invite
        email:
          type: string
          format: email
          title: Email
          description: The email of the user that being invited
        first_name:
          anyOf:
          - type: string
          - type: 'null'
          title: First Name
          description: The first name of the user that is being invited
        last_name:
          anyOf:
          - type: string
          - type: 'null'
          title: Last Name
          description: The last name of the user that is being invited
        role_id:
          type: string
          format: uuid
          title: Role Id
          description: The role of the user that is being invited
        tenant_id:
          type: string
          format: uuid
          title: Tenant Id
          description: The tenant id of the user that is being invited
        resource_instance_id:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Resource Instance Id
          description: The resource instance id of the user that is being invited
      additionalProperties: false
      type: object
      required:
      - id
      - organization_id
      - project_id
      - environment_id
      - created_at
      - updated_at
      - key
      - status
      - email
      - first_name
      - last_name
      - role_id
      - tenant_id
      - resource_instance_id
      title: ElementsUserInviteRead
    UserRole:
      properties:
        role:
          type: string
          title: Role
          description: the role that is assigned
        tenant:
          type: string
          title: Tenant
          description: the tenant the role is associated with
      additionalProperties: false
      type: object
      required:
      - role
      - tenant
      title: UserRole
    UserRead:
      properties:
        key:
          type: string
          title: Key
          description: A unique id by which Permit will identify the user for permission checks.
        id:
          type: string
          format: uuid
          title: Id
          description: Unique id of the user
        organization_id:
          type: string
          format: uuid
          title: Organization Id
          description: Unique id of the organization that the user belongs to.
        project_id:
          type: string
          format: uuid
          title: Project Id
          description: Unique id of the project that the user belongs to.
        environment_id:
          type: string
          format: uuid
          title: Environment Id
          description: Unique id of the environment that the user belongs to.
        associated_tenants:
          items:
            $ref: '#/components/schemas/UserInTenant'
          type: array
          title: Associated Tenants
          default: []
        roles:
          items:
            $ref: '#/components/schemas/UserRole'
          type: array
          title: Roles
          default: []
          deprecated: true
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Date and time when the user was created (ISO_8601 format).
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: Date and time when the user was last updated/modified (ISO_8601 format).
        email:
          anyOf:
          - type: string
            format: email
          - type: 'null'
          title: Email
          description: The email of the user. If synced, will be unique inside the environment.
        first_name:
          anyOf:
          - type: string
          - type: 'null'
          title: First Name
          description: First name of the user.
        last_name:
          anyOf:
          - type: string
          - type: 'null'
          title: Last Name
          description: Last name of the user.
        attributes:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Attributes
          description: Arbitrary user attributes that will be used to enforce attribute-based access control policies.
          default: {}
      additionalProperties: false
      type: object
      required:
      - key
      - id
      - organization_id
      - project_id
      - environment_id
      - created_at
      - updated_at
      title: UserRead
      example:
        associated_tenants:
        - roles:
          - admin
          status: active
          tenant: stripe-inc
        - roles:
          - viewer
          status: pending
          tenant: othercompany.com
        attributes:
          age: 30
          department: marketing
          subscription:
            expired: false
            tier: pro
        created_at: '2019-08-24T14:15:22Z'
        email: jane@coolcompany.com
        environment_id: 40ef0e48-a11f-4963-a229-e396c9f7e7c4
        first_name: Jane
        id: 497f6eca-6276-4993-bfeb-53cbbbba6f08
        key: user|892179821739812389327
        last_name: Doe
        organization_id: 7c60d51f-b44e-4682-87d6-449835ea4de6
        project_id: 405d8375-3514-403b-8c43-83ae74cfe0e9
        roles:
        - role: admin
          tenant: stripe-inc
        - role: viewer
          tenant: othercompany.com
        updated_at: '2019-08-24T14:15:22Z'
    UserInviteStatus:
      type: string
      enum:
      - pending
      - approved
      title: UserInviteStatus
    UserStatus:
      type: string
      enum:
      - active
      - pending
      title: UserStatus
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ApproveMessage:
      properties:
        detail:
          type: string
          title: Detail
      additionalProperties: false
      type: object
      required:
      - detail
      title: ApproveMessage
      description: 'The body of an approve route''s 400 or 403 refusal — the key FastAPI''s own

        `HTTPException` uses.'
  securitySchemes:
    HTTPBearer:
      type: http
      description: 'Authorization header, we support the bearer authentication scheme (see: RFC 6750)'
      scheme: bearer
      bearerFormat: JWT