---
updatedAt: 2026-05-18T19:30:33.000Z
agentTools:
  projectIndex: https://api.help.mabl.com/llms.txt
---

# Invite user to workspace

Create link or email based workspace invite. For email invites, invite emails are sent to the invited users.

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "mabl API",
    "description": "APIs for interacting with mabl services",
    "version": "0.563.3-2026-10-09.1791576280-jbaldassari-1791576682-SNAPSHOT"
  },
  "servers": [
    {
      "url": "https://api.mabl.com/"
    }
  ],
  "components": {
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic"
      },
      "bearerAuth": {
        "type": "apiKey",
        "name": "Authorization",
        "in": "header"
      }
    },
    "schemas": {
      "CreateOrganizationInvitationRequest": {
        "type": "object",
        "required": [
          "invitee_role"
        ],
        "properties": {
          "invitee_email": {
            "type": "string",
            "description": "The e-mail address allowed to accept a EMAIL based invitation. Required for EMAIL based invitations."
          },
          "invite_type": {
            "type": "string",
            "enum": [
              "email",
              "link"
            ],
            "default": "email"
          },
          "allow_list_emails": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The e-mail addresses allowed to accept a LINK based invitation. Required for LINK based invitations."
          },
          "invitee_role": {
            "$ref": "#/components/schemas/UserRole",
            "description": "The role to grant to the invitee"
          },
          "validity_seconds": {
            "type": "integer",
            "description": "The number of seconds this invite should be valid for",
            "minimum": 360,
            "maximum": 604800
          }
        }
      },
      "ErrorResponseGeneric": {
        "properties": {
          "code": {
            "type": "integer",
            "format": "int32",
            "minimum": 100,
            "maximum": 599
          },
          "id": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "UserRoleEnum": {
        "description": "The possible values for user role",
        "type": "string",
        "enum": [
          "owner",
          "editor",
          "viewer"
        ]
      },
      "OrganizationInvitation": {
        "type": "object",
        "properties": {
          "created_time": {
            "type": "integer",
            "format": "int64",
            "description": "Time at which the organization invitation was created",
            "readOnly": true
          },
          "expiration_time": {
            "type": "integer",
            "format": "int64",
            "description": "The timestamp that this invitation is valid until (max 7 days)"
          },
          "allow_list_emails": {
            "type": "array",
            "description": "The e-mail addresses that are allowed to accept this invitation (when invite supports multiple invitees)",
            "items": {
              "type": "string"
            }
          },
          "created_by_name": {
            "type": "string",
            "description": "Display name of the user who created this invitation (server-resolved)"
          },
          "invitee_role": {
            "$ref": "#/components/schemas/UserRole",
            "description": "Role for invited user"
          },
          "invitee_email": {
            "type": "string",
            "description": "The e-mail address to which the invitation should be sent (singular recipient)"
          },
          "invite_type": {
            "type": "string",
            "enum": [
              "email",
              "link"
            ]
          },
          "is_expired": {
            "type": "boolean",
            "description": "Whether this invitation has effectively expired (server-resolved)"
          },
          "last_replayed_time": {
            "type": "integer",
            "format": "int64",
            "description": "Time at which the organization invitation was last replayed (re-sent)",
            "readOnly": true
          },
          "last_updated_time": {
            "type": "integer",
            "format": "int64",
            "description": "Time at which the organization invitation was last updated",
            "readOnly": true
          },
          "accept_uri": {
            "type": "string",
            "description": "The URI that the user should request in order to accept the invitation. Only returned upon creation for Link type invites, otherwise passed via invite email."
          },
          "last_updated_by_id": {
            "type": "string",
            "description": "The ID of the user who last updated this organization invitation",
            "readOnly": true
          },
          "accepted_by_emails": {
            "type": "array",
            "description": "Email addresses that have accepted this invitation (link-type only)",
            "items": {
              "type": "string"
            }
          },
          "id": {
            "type": "string",
            "description": "The ID of the organization invitation",
            "readOnly": true
          },
          "created_by_id": {
            "type": "string",
            "description": "The ID of the user who created this organization invitation",
            "readOnly": true
          }
        }
      },
      "UserRole": {
        "type": "object",
        "required": [
          "role"
        ],
        "properties": {
          "workspace_id": {
            "type": "string",
            "description": "The workspace this role applies to. Preferred over `organization_id`. At least one of `workspace_id` or `organization_id` must be present."
          },
          "role": {
            "$ref": "#/components/schemas/UserRoleEnum"
          }
        }
      }
    },
    "responses": {
      "ErrorResponse": {
        "description": "Unknown error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponseGeneric"
            }
          }
        }
      },
      "ErrorResponse401": {
        "description": "User not authenticated",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponseGeneric"
            }
          }
        }
      },
      "ErrorResponse404": {
        "description": "Entity not found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponseGeneric"
            }
          }
        }
      },
      "ErrorResponse403": {
        "description": "User not authorized",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponseGeneric"
            }
          }
        }
      },
      "ErrorResponse400": {
        "description": "Invalid or missing parameter",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponseGeneric"
            }
          }
        }
      }
    }
  },
  "security": [
    {
      "basicAuth": []
    },
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/workspaces/invitations": {
      "post": {
        "summary": "Invite user to workspace",
        "requestBody": {
          "description": "The workspace invitation created",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateOrganizationInvitationRequest"
              }
            }
          },
          "required": true
        },
        "operationId": "createOrganizationInvitation",
        "description": "Create link or email based workspace invite. For email invites, invite emails are sent to the invited users.",
        "responses": {
          "201": {
            "description": "The created invitation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationInvitation"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse400"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse401"
          },
          "403": {
            "$ref": "#/components/responses/ErrorResponse403"
          },
          "404": {
            "description": "Workspace not found",
            "$ref": "#/components/responses/ErrorResponse404"
          },
          "409": {
            "description": "Invitation already exists for the specified e-mail address and workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseGeneric"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseGeneric"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        },
        "tags": [
          "WorkspaceInvitation"
        ]
      }
    }
  },
  "tags": [
    {
      "name": "WorkspaceInvitation"
    }
  ]
}
```