# Open a deal

`POST /crm/deals` · Rivier · contacts

Open a deal.

- Scope: contacts:write
- Graphql: Mutation.contactsDealCreate
- Sdk: contacts.deal.create
- Cli: contacts deal create

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    },
    "pipelineId": {
      "type": "string",
      "format": "uuid"
    },
    "stage": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9_]{0,39}$"
    },
    "amountMinor": {
      "type": "integer",
      "minimum": 0,
      "maximum": 1000000000000
    },
    "currency": {
      "type": "string",
      "minLength": 3,
      "maxLength": 3
    },
    "contactId": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ]
    },
    "companyId": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ]
    },
    "owner": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 200
        },
        {
          "type": "null"
        }
      ]
    },
    "closeDate": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        {
          "type": "null"
        }
      ]
    },
    "custom": {
      "type": "object",
      "additionalProperties": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 2000
          },
          {
            "type": "number"
          },
          {
            "type": "boolean"
          },
          {
            "type": "null"
          }
        ]
      },
      "propertyNames": {
        "pattern": "^[a-z][a-z0-9_]{0,39}$"
      }
    }
  },
  "required": [
    "name",
    "pipelineId"
  ],
  "additionalProperties": false
}
```

## Responses

- `201`: Success
- `400`: The request was malformed
- `401`: No valid credential
- `403`: The credential lacks the scope, origin or address
- `429`: Over the key's rate limit; see Retry-After

## Example

```sh
curl -X POST 'https://api.rivier.ai/crm/deals' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string",
  "pipelineId": "string"
}'
```
