---
updatedAt: 2026-08-24T07:56:26.000Z
agentTools:
  projectIndex: https://docs.allegrow.co/llms.txt
---

# Invite User

Invites a new user to your workspace. Allegrow sends the invite email, the invitation consumes a seat, and the invitee appears on the users list as `status: invited` until they sign up.

The API key must belong to a user whose role has the invite-members permission in your workspace — the same rule the in-app invite flow enforces. Re-inviting an email that already has a **pending invite** replaces it with a fresh invite code and a new 30-day expiry; inviting an email that already belongs to an **active user** is rejected with a `409`.


Invites a new user to your workspace. Allegrow sends the invite email, the invitation **consumes a seat**, and the invitee appears on [List Users](/reference/list-users) as `status: invited` until they sign up.

The API key must belong to a user whose role can invite members — the same rule the in-app invite flow enforces. If it can't, you get a **403**.

Re-inviting an email with a **pending invite** replaces it: a fresh invite email goes out with a new code and a new 30-day expiry. Inviting an email that already belongs to an **active user** returns a **409**, as does running out of seats — the `error` message tells you which.

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Allegrow Workspace API",
    "description": "The Allegrow Workspace API provides read-only, programmatic access to your workspace's connected mailboxes, sender reputation, sending domains, Safety Net mailboxes, and users — the same data shown in the Allegrow app, ready to plug into your own dashboards and BI tooling.\n",
    "version": "1.0.0",
    "contact": {
      "name": "Allegrow Support",
      "email": "support@allegrow.co"
    }
  },
  "servers": [
    {
      "url": "https://api.allegrow.co",
      "description": "Production API"
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "paths": {
    "/v1/users": {
      "post": {
        "summary": "Invite User",
        "description": "Invites a new user to your workspace. Allegrow sends the invite email, the invitation consumes a seat, and the invitee appears on the users list as `status: invited` until they sign up.\n\nThe API key must belong to a user whose role has the invite-members permission in your workspace — the same rule the in-app invite flow enforces. Re-inviting an email that already has a **pending invite** replaces it with a fresh invite code and a new 30-day expiry; inviting an email that already belongs to an **active user** is rejected with a `409`.\n",
        "operationId": "inviteUser",
        "tags": [
          "Users"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email",
                    "description": "The invitee's email address.",
                    "example": "new.rep@allegrow.co"
                  },
                  "firstName": {
                    "type": "string",
                    "maxLength": 255,
                    "description": "Used to personalise the invite email.",
                    "example": "Ada"
                  },
                  "lastName": {
                    "type": "string",
                    "maxLength": 255,
                    "example": "Lovelace"
                  },
                  "role": {
                    "type": "string",
                    "enum": [
                      "member",
                      "admin"
                    ],
                    "default": "member",
                    "description": "The role the invitee will hold once they sign up.",
                    "example": "member"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Invite created and email sent. The body is the invitee's entry as it will appear on GET /v1/users (`status: invited`, `id: null`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/User"
                },
                "example": {
                  "email": "new.rep@allegrow.co",
                  "firstName": "Ada",
                  "id": null,
                  "inviteExpiresAt": "2026-09-23T14:00:00Z",
                  "lastName": "Lovelace",
                  "mailboxes": [],
                  "role": "member",
                  "status": "invited"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleError"
                },
                "example": {
                  "error": "role must be one of: member, admin"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/MissingApiKeyError"
          },
          "403": {
            "description": "The API key's user does not have permission to invite members.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleError"
                },
                "example": {
                  "error": "API key does not have permission to invite users"
                }
              }
            }
          },
          "409": {
            "description": "The invite cannot be created in the workspace's current state — the email already belongs to an active user, the workspace has no seats remaining, or the workspace is not configured for invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleError"
                },
                "examples": {
                  "alreadyExists": {
                    "summary": "Email already belongs to an active user",
                    "value": {
                      "error": "A user with this email already exists"
                    }
                  },
                  "seatLimit": {
                    "summary": "No seats remaining",
                    "value": {
                      "error": "Seat limit reached"
                    }
                  },
                  "notConfigured": {
                    "summary": "Workspace cannot send invites",
                    "value": {
                      "error": "Company is not configured for invites"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitError"
          },
          "503": {
            "description": "A dependent Allegrow service is temporarily unavailable. Retry after the number of seconds in the `Retry-After` header.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Suggested seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleError"
                },
                "example": {
                  "error": "Service temporarily unavailable"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "Your Allegrow API key"
      }
    },
    "responses": {
      "MissingApiKeyError": {
        "description": "Unauthorized - API key missing from the request",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "Unauthorized",
              "message": "Unauthorized",
              "statusCode": 401
            }
          }
        }
      },
      "RateLimitError": {
        "description": "Rate limit exceeded. Requests count against the same per-second rate limit as validation API calls.",
        "headers": {
          "Retry-After": {
            "description": "Suggested seconds to wait before retrying",
            "schema": {
              "type": "integer"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "Too Many Requests",
              "message": "Too Many Requests",
              "statusCode": 429
            }
          }
        }
      }
    },
    "schemas": {
      "User": {
        "type": "object",
        "required": [
          "email",
          "firstName",
          "id",
          "lastName",
          "mailboxes",
          "role",
          "status"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "Opaque identifier for this user — use it with GET /v1/users/{id}. Always `null` for `invited` users; the id is created when they sign up.",
            "example": "550e8400-e29b-41d4-a716-446655440000"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the user signed up. Present on `active` users only.",
            "example": "2025-11-02T09:14:00Z"
          },
          "email": {
            "type": "string",
            "format": "email",
            "example": "rep@allegrow.co"
          },
          "firstName": {
            "type": "string",
            "nullable": true,
            "example": "Ada"
          },
          "inviteExpiresAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the pending invite expires. Present on `invited` users only.",
            "example": "2026-09-01T00:00:00Z"
          },
          "lastName": {
            "type": "string",
            "nullable": true,
            "example": "Lovelace"
          },
          "mailboxes": {
            "type": "array",
            "description": "The user's connected mailboxes, sorted by email ascending. Empty when the user has not connected any mailbox.",
            "items": {
              "type": "object",
              "required": [
                "connectionStatus",
                "email"
              ],
              "properties": {
                "connectionStatus": {
                  "type": "string",
                  "nullable": true,
                  "description": "Current connection state. Common values are `connected`, `disconnected`, and `credentials_error`.",
                  "example": "connected"
                },
                "email": {
                  "type": "string",
                  "format": "email",
                  "example": "rep@allegrow.co"
                }
              }
            }
          },
          "role": {
            "type": "string",
            "nullable": true,
            "description": "The user's role in the workspace.",
            "example": "member"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "invited"
            ],
            "description": "`active` users have signed up; `invited` users have a pending invitation.",
            "example": "active"
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "message",
          "error",
          "statusCode"
        ],
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message"
          },
          "error": {
            "type": "string",
            "description": "Error type"
          },
          "statusCode": {
            "type": "integer",
            "description": "HTTP status code"
          }
        }
      },
      "SimpleError": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "Error message"
          }
        }
      }
    }
  }
}
```