# Create company member

`POST /api/v1/Outlets/{outletId}/Companies/{companyId}/Members`

Core API · Companies · base URL `https://core-api.ancon.io` · auth: `Access-Token` header · docs: https://ancon.dev/api/core/companies/create-company-member

**Deprecated.**

Will no longer work after 2027-03-31 00:00, move over to user service instead.

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `outletId` | string (uuid) | yes |  |
| `companyId` | string (uuid) | yes |  |

## Header parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `correlationId` | string | no | Correlation Id for the request |

## Request body

Content type: `application/json`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `firstName` | string or null | no |  |
| `lastName` | string or null | no |  |
| `email` | string (email) or null | no |  |
| `phoneNumber` | string or null | no |  |
| `department` | string or null | no |  |

### Example

```json
{
  "firstName": "John",
  "lastName": "Doe",
  "email": "johnjoe@ancon.io",
  "phoneNumber": "123456789",
  "department": "IT"
}
```

## Responses

| Status | Description |
| --- | --- |
| 201 | Created |
| 400 | Bad Request |

### 201 response (`application/json`)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `companyMember` | object or null | no |  |
| `companyMember.id` | string (uuid) | no |  |
| `companyMember.fullName` | string or null | no |  |
| `companyMember.name` | object or null | no |  |
| `companyMember.name.firstName` | string or null | no |  |
| `companyMember.name.lastName` | string or null | no |  |
| `companyMember.email` | string or null | no |  |
| `companyMember.phoneNumber` | string or null | no |  |
| `companyMember.department` | string or null | no |  |

#### Example

```json
{
  "companyMember": {
    "id": "52e9dc49-4b99-46aa-806a-d25d6a76d149",
    "fullName": "John Doe",
    "name": {
      "firstName": "John",
      "lastName": "Doe"
    },
    "email": "johnjoe@ancon.io",
    "phoneNumber": "123456789",
    "department": "IT"
  }
}
```

### 400 response (`application/json`)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `message` | string or null | no |  |
| `errorCode` | string (uuid) | no |  |
| `additionalData` | any or null | no |  |

#### Delivery request is not valid

```json
{
  "message": "Delivery information is not valid!",
  "errorCode": "41fcedd1-dfef-4d0d-a5b3-2e28da7dfc9a",
  "additionalData": null
}
```

## Example request

```bash
curl -X POST "https://core-api.ancon.io/api/v1/Outlets/{outletId}/Companies/{companyId}/Members" \
  -H "Access-Token: $ANCON_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "firstName": "John",
  "lastName": "Doe",
  "email": "johnjoe@ancon.io",
  "phoneNumber": "123456789",
  "department": "IT"
}'
```
