# Update a tool's sync settings

```http
PATCH https://trydimmi.com/api/v1/integration-installations/{installation}/issue-settings
```

## Authorization

Send an API token as `Authorization: Bearer <token>`.
The token needs: `settings:write`.

## Path parameters

- `installation` (string, required): Id of the connected tool, starting with itg_, such as itg_01jx2m8k4t. Find it with GET /integrations.

## Body

- `deploy_environment` (string): The GitHub environment whose successful deployments count as a fix shipped, by name from the "environments" list of the repository, such as "production". Empty means any environment of the deploy repository.
- `deploy_repository` (string): The GitHub repository whose successful deployments mark done issues as shipped, as owner/name from the tool's "teams" list, such as "acme/api". Empty turns this off.
- `from_email` (string): An email address, such as support@example.com.
- `impact_field_id` (string): Id of the ticket field, starting with tktf_, such as tktf_01jx2m8k4t. Find it with GET /ticket-types/{type}/fields.
- `project_id` (string): The default for new issues when none is picked: an id from the tool's "projects" list for the team, a Linear project or a Jira issue type, such as "10001". Empty clears it.
- `service_id` (string): The default service new incidents are raised on when none is picked: an id from the tool's "services" list, such as "PABC123". Empty clears it.
- `severity_id` (string): The default severity new incidents are declared with when none is picked: an id from the tool's "severities" list. Empty clears it.
- `signing_secret` (string): The signing secret, as text. It is stored encrypted and never shown again.
- `states` (object): A JSON object mapping the tool's status ids, from its "states" list, to the dimmi ticket state a ticket moves to, such as {"started": "tkts_01hzy3v8k2m4n6p8q0r2s4t6v8"}. It replaces the whole mapping; an empty value drops that status.
- `team_id` (string): Id of the team, starting with team_, such as team_01jx2m8k4t. Find it with GET /teams.

## Response 200 (OK)

- `data` (object, required)
  - `deploy_environment` (string, required): The deployment environment that counts as shipped, such as production. Empty means any environment of the repository.
  - `deploy_repository` (string, required): The repository whose successful deployments prove a fix shipped. Empty when not set.
  - `from_email` (string, required): The email address dimmi acts as when it calls the tool, used by PagerDuty. Empty when not set.
  - `has_signing_secret` (boolean, required): True when the secret that signs the tool's deliveries has been saved.
  - `impact_field_id` (string, required): Id of the tool's field where dimmi writes how many customers an incident reaches. Empty when not set.
  - `installation_id` (string, required): Id of the installation these settings belong to, starting with itg_.
  - `needs_signing_secret` (boolean, required): True when this tool needs a signing secret pasted before its deliveries can be trusted.
  - `object` (string, required): The kind of record this is, the same for every record of its kind, such as article.
  - `project_id` (string, required): The tool's id of the project new issues go to by default. Empty when not set.
  - `provider` (string, required): The tool these settings are for, such as linear, jira or github.
  - `service_id` (string, required): The tool's id of the service new incidents go to by default. Empty when not set.
  - `severity_id` (string, required): The tool's id of the severity new incidents get by default. Empty when not set.
  - `states` (object, required): Which dimmi ticket state each of the tool's statuses maps to: keys are the tool's status ids, values are state ids starting with tkts_.
  - `team_id` (string, required): The tool's id of the team new issues go to by default. Empty when not set.
  - `webhook_url` (string, required): The address to give the tool so it delivers its updates to dimmi.

## Response default (Error)

- `code` (string, required): Stable code for programs to tell errors apart, such as validation_failed or internal_error.
- `errors` (object): Each rejected field mapped to its messages. Only present when the input was invalid.
- `message` (string, required): What went wrong, in words safe to show a person.

## Example request

```bash
curl --request PATCH \
  --url 'https://trydimmi.com/api/v1/integration-installations/{installation}/issue-settings' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "deploy_environment": "<string>",
  "deploy_repository": "<string>",
  "from_email": "<string>",
  "impact_field_id": "<string>",
  "project_id": "<string>",
  "service_id": "<string>",
  "severity_id": "<string>",
  "signing_secret": "<string>",
  "states": {
    "<key>": "<string>"
  },
  "team_id": "<string>"
}'
```

## Example response

```json
{
  "data": {
    "deploy_environment": "<string>",
    "deploy_repository": "<string>",
    "from_email": "<string>",
    "has_signing_secret": true,
    "impact_field_id": "<string>",
    "installation_id": "<string>",
    "needs_signing_secret": true,
    "object": "<string>",
    "project_id": "<string>",
    "provider": "<string>",
    "service_id": "<string>",
    "severity_id": "<string>",
    "states": {
      "<key>": "<string>"
    },
    "team_id": "<string>",
    "webhook_url": "<string>"
  }
}
```

---

Index of all dimmi docs: https://trydimmi.com/llms.txt (full text: https://trydimmi.com/llms-full.txt)
