# Accept employee/user/candidate invite.

`POST /api/invite/accept`

Authentication: no security requirement declared for this operation.

Parameters:

- `origin` (header, string, required)
  Type: string

Request body: application/json (required)

Type: object

Schema: [AcceptInviteDTO](https://sourcey-gauzy.pages.dev/api-reference/models/acceptinvitedto/index.md)

- `email` (required)
  Type: string

- `token` (optional)
  Type: string

- `code` (optional)
  Type: string

- `password` (optional)
  Type: string

- `user` (required)
  Reference: [AcceptInviteUserDTO](https://sourcey-gauzy.pages.dev/api-reference/models/acceptinviteuserdto/index.md); Type: object

- `terms` (optional)
  Type: array
  
  Items:
    Reference: [TermsAcceptanceClaimDTO](https://sourcey-gauzy.pages.dev/api-reference/models/termsacceptanceclaimdto/index.md); Type: object

Responses:

- 201: The record has been successfully executed.

- 400: Invalid input, The response body may contain clues as to what went wrong

## Examples

### cURL

```bash
curl -X POST 'http://localhost:3000/api/invite/accept' \
  -H 'origin: string' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "email": "string",
  "token": "string",
  "code": "string",
  "password": "string",
  "user": {
    "firstName": "string",
    "lastName": "string",
    "imageUrl": "string",
    "preferredLanguage": "en",
    "timeZone": "string"
  },
  "terms": [
    {
      "documentId": "tos:gauzy",
      "version": "1.0.0",
      "sha256": "string",
      "locale": "en"
    }
  ]
}'
```

### JavaScript

```javascript
const body = `{
  "email": "string",
  "token": "string",
  "code": "string",
  "password": "string",
  "user": {
    "firstName": "string",
    "lastName": "string",
    "imageUrl": "string",
    "preferredLanguage": "en",
    "timeZone": "string"
  },
  "terms": [
    {
      "documentId": "tos:gauzy",
      "version": "1.0.0",
      "sha256": "string",
      "locale": "en"
    }
  ]
}`;

const response = await fetch('http://localhost:3000/api/invite/accept', {
  method: 'POST',
  headers: {
    'origin': 'string',
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### Python

```python
import requests

body = '''{
  "email": "string",
  "token": "string",
  "code": "string",
  "password": "string",
  "user": {
    "firstName": "string",
    "lastName": "string",
    "imageUrl": "string",
    "preferredLanguage": "en",
    "timeZone": "string"
  },
  "terms": [
    {
      "documentId": "tos:gauzy",
      "version": "1.0.0",
      "sha256": "string",
      "locale": "en"
    }
  ]
}'''

response = requests.post(
    'http://localhost:3000/api/invite/accept',
    data=body.encode('utf-8'),
    headers={
        'origin': 'string',
        'Content-Type': 'application/json',
    },
)
print(response.text)
```
