# Invite a new member

`POST /api/member/invite`

URL: https://repsona.com/api/post-member-invite

Creates an inviting user and issues a password-set link. Re-invites refresh the link. no-login members can be created without an email and receive no mail.

## Request body

| name | in | type | required | description |
| --- | --- | --- | --- | --- |
| `email` | body | string |  | Email address to send the invitation to. Required unless `role` is `no-login`. |
| `role` | body | admin \| member \| no-login | required | Role of the new member. `admin` can manage the space, `member` is a regular member, and `no-login` is a member who cannot log in (not billed, no email is sent). |
| `name` | body | string |  | Username (@name), 3 to 15 characters of letters, digits, `.`, `_` and `-`. Generated from the email address if omitted. |
| `fullName` | body | string |  | Display name, up to 255 characters. Defaults to the part of the email address before the @. |
| `projectIds` | body | integer[] |  | IDs of projects to add the member to (up to 100). |

## Request

```sh
curl -X POST "https://<space>.repsona.com/api/member/invite" \
  -H "Authorization: Bearer $REPSONA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "noah.rivera@example.com",
    "role": "member",
    "name": "noah",
    "fullName": "Noah Rivera",
    "projectIds": [
      297
    ]
  }'
```

## Responses

- 200: Invited
- 400: Email already exists
- 401: Authentication is required
- 403: Admin only

## Example response

```json
{
  "userId": 1129
}
```
