# Change a map

`PUT /crm/maps/{id}` · Rivier · contacts

Change a map.

- Scope: contacts:write
- Graphql: Mutation.contactsMapUpdate
- Sdk: contacts.map.update
- Cli: contacts map update

## Parameters

- `id` (path, required), string

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "title": {
      "type": "string",
      "maxLength": 160
    },
    "loadMode": {
      "type": "string",
      "enum": [
        "consent",
        "click",
        "always"
      ],
      "default": "consent"
    },
    "locations": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9-]{0,40}$"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "address": {
            "type": "string",
            "minLength": 3,
            "maxLength": 300
          },
          "lat": {
            "type": "number",
            "minimum": -90,
            "maximum": 90
          },
          "lng": {
            "type": "number",
            "minimum": -180,
            "maximum": 180
          },
          "phone": {
            "type": "string",
            "maxLength": 40
          },
          "url": {
            "type": "string",
            "format": "uri",
            "maxLength": 300
          },
          "hours": {
            "type": "string",
            "maxLength": 300
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 40
            },
            "maxItems": 10
          }
        },
        "required": [
          "id",
          "name",
          "address"
        ],
        "additionalProperties": false
      },
      "minItems": 1,
      "maxItems": 500
    },
    "defaultLanguage": {
      "type": "string",
      "pattern": "^[a-z]{2}(-[A-Za-z]{2})?$",
      "default": "en"
    },
    "labels": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 160
          },
          "search": {
            "type": "string",
            "maxLength": 60
          },
          "loadMap": {
            "type": "string",
            "maxLength": 60
          },
          "directions": {
            "type": "string",
            "maxLength": 60
          },
          "allTags": {
            "type": "string",
            "maxLength": 60
          },
          "noResults": {
            "type": "string",
            "maxLength": 100
          }
        },
        "additionalProperties": false
      },
      "propertyNames": {
        "pattern": "^[a-z]{2}(-[A-Za-z]{2})?$"
      }
    },
    "design": {
      "type": "object",
      "properties": {
        "theme": {
          "type": "string",
          "enum": [
            "auto",
            "light",
            "dark"
          ],
          "default": "auto"
        },
        "size": {
          "type": "string",
          "enum": [
            "compact",
            "regular",
            "large"
          ],
          "default": "regular"
        },
        "accent": {
          "type": "string",
          "pattern": "^#[0-9a-f]{6}$"
        }
      },
      "additionalProperties": false,
      "default": {}
    },
    "cluster": {
      "type": "boolean",
      "default": true
    },
    "locator": {
      "type": "boolean",
      "default": true
    },
    "zoom": {
      "type": "number",
      "minimum": 1,
      "maximum": 18,
      "default": 13
    },
    "allowedOrigins": {
      "type": "array",
      "items": {
        "type": "string",
        "maxLength": 200
      },
      "maxItems": 20
    }
  },
  "required": [
    "name",
    "locations"
  ],
  "additionalProperties": false
}
```

## Responses

- `200`: 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 PUT 'https://api.rivier.ai/crm/maps/{id}' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string",
  "locations": [
    {
      "id": "string",
      "name": "string",
      "address": "string"
    }
  ]
}'
```
