# Invite someone to the workspace

`POST /api/v1/team/invites`

Requires `team.manage`. Re-inviting an address replaces its pending invite rather than adding a second. The token is returned ONCE; only its sha256 is stored.

No API key can call this route: it needs a signed-in dashboard user with the right role. A key answers 403.

## Request body

JSON Schema:

```json
{
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "format": "email"
    },
    "role": {
      "type": "string",
      "enum": [
        "owner",
        "admin",
        "developer",
        "finance",
        "viewer"
      ]
    }
  },
  "required": [
    "email",
    "role"
  ]
}
```

## Responses

### 201

The invite, its one-time token and the accept link.

JSON Schema:

```json
{
  "type": "object",
  "properties": {
    "data": {
      "allOf": [
        {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "format": "uuid",
              "example": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
            },
            "emailLower": {
              "type": "string",
              "format": "email"
            },
            "role": {
              "type": "string",
              "enum": [
                "owner",
                "admin",
                "developer",
                "finance",
                "viewer"
              ]
            },
            "status": {
              "type": "string",
              "enum": [
                "pending",
                "accepted",
                "revoked",
                "expired"
              ]
            },
            "expiresAt": {
              "type": "string",
              "format": "date-time"
            },
            "createdAt": {
              "type": "string",
              "format": "date-time"
            }
          },
          "required": [
            "id",
            "emailLower",
            "role",
            "status",
            "expiresAt",
            "createdAt"
          ]
        },
        {
          "type": "object",
          "properties": {
            "token": {
              "type": "string",
              "description": "Shown once. Never retrievable again."
            },
            "accept_url": {
              "type": "string",
              "format": "uri"
            }
          },
          "required": [
            "token",
            "accept_url"
          ]
        }
      ]
    },
    "_agent": {
      "type": "object",
      "properties": {
        "summary": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "ok"
          ]
        },
        "next_actions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "warnings": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "summary",
        "status",
        "next_actions",
        "warnings"
      ]
    },
    "api_version": {
      "type": "string",
      "example": "2026-07-01"
    }
  },
  "required": [
    "data",
    "_agent",
    "api_version"
  ]
}
```
