Tickets can be shared between Zendesk accounts. To enable ticket sharing, a sharing agreement must be sent by one account and accepted by the other account. Sharing agreements work as follows:

  • Any Zendesk account can invite another account to establish a sharing agreement.
  • The initiating account (the sender) sets the terms of the sharing agreement, which the receiving account can accept or not.
  • Sharing agreements are one way. Once the receiver accepts the agreement, the sender may share tickets with the receiver. If the receiver wants to share tickets with the sender, they must create and send a sharing agreement to the other account.

To learn more, see Sharing tickets with other Zendesk accounts in Zendesk help.

JSON Format

Sharing Agreements are represented as JSON objects with the following properties:

Name Type Read-only Mandatory Description
created_at string true false The time the record was created
id integer true false Automatically assigned upon creation
name string false false Name of this sharing agreement
partner_name string false false Can be one of the following: "jira", null
remote_subdomain string false false Subdomain of the remote account or null if not associated with an account
status string false false Can be one of the following: "accepted", "declined", "pending", "inactive"
type string false false Can be one of the following: "inbound", "outbound"
url string true false URL of the sharing agreement record

Example

{  "created_at": "2012-02-20T22:55:29Z",  "id": 88335,  "name": "Ticket Sharing",  "partner_name": "jira",  "status": "accepted",  "type": "inbound",  "url": "https://company.zendesk.com/api/v2/agreements/88335.json"}

List Sharing Agreements

  • GET /api/v2/sharing_agreements

Allowed For

  • Agents

Using curl

curl https://{subdomain}.zendesk.com/api/v2/sharing_agreements.json \  -v -u {email_address}:{password}

Example Response

Status 200 OK
{  "sharing_agreements": [    {      "created_at": "2012-02-20T22:55:29Z",      "id": 1,      "name": "Foo @ Zendesk",      "partner_name": "jira",      "status": "accepted",      "type": "inbound",      "url": "https://company.zendesk.com/api/v2/agreements/1.json"    }  ]}

Show a Sharing Agreement

  • GET /api/v2/sharing_agreements/{sharing_agreement_id}

Returns a sharing agreement for your account.

Allowed For

  • Agents

Parameters

Name Type In Required Description
sharing_agreement_id integer Path true The ID of the sharing agreement

Using curl

curl https://{subdomain}.zendesk.com/api/v2/sharing_agreements/{sharing_agreement_id}.json \  -v -u {email_address}:{password}

Example Response

Status 200 OK
{  "sharing_agreement": {    "created_at": "2012-02-20T22:55:29Z",    "id": 1,    "name": "Foo @ Zendesk",    "partner_name": null,    "remote_subdomain": "foo",    "status": "accepted",    "type": "inbound",    "url": "https://company.zendesk.com/api/v2/agreements/1.json"  }}

Create Sharing Agreement

  • POST /api/v2/sharing_agreements

Allowed For

  • Admins

Using curl

curl https://{subdomain}.zendesk.com/api/v2/sharing_agreements.json \  -H "Content-Type: application/json" -X POST \  -d '{"sharing_agreement": {"remote_subdomain": "Foo"}}' \  -v -u {email_address}:{password}

Example Response

Status 201 Created
{  "sharing_agreement": {    "created_at": "2012-02-20T22:55:29Z",    "id": 1,    "name": "Foo @ Zendesk",    "partner_name": null,    "remote_subdomain": "foo",    "status": "accepted",    "type": "inbound",    "url": "https://company.zendesk.com/api/v2/agreements/1.json"  }}

Update a Sharing Agreement

  • PUT /api/v2/sharing_agreements/{sharing_agreement_id}

Returns an updated sharing agreement. Only status is allowed to be updated.

Allowed For

  • Admins

Parameters

Name Type In Required Description
sharing_agreement_id integer Path true The ID of the sharing agreement

Using curl

curl https://{subdomain}.zendesk.com/api/v2/sharing_agreements/{sharing_agreement_id}.json \  -H "Content-Type: application/json" -X PUT \  -d '{"sharing_agreement": {"status": "accepted"}}' \  -v -u {email_address}:{password}

Example Response

Status 200 OK
{  "sharing_agreement": {    "created_at": "2012-02-20T22:55:29Z",    "id": 1,    "name": "Foo @ Zendesk",    "partner_name": null,    "remote_subdomain": "foo",    "status": "accepted",    "type": "inbound",    "url": "https://company.zendesk.com/api/v2/agreements/1.json"  }}

Delete a Sharing Agreement

  • DELETE /api/v2/sharing_agreements/{sharing_agreement_id}

Deletes a sharing agreement.

Allowed For

  • Admins

Parameters

Name Type In Required Description
sharing_agreement_id integer Path true The ID of the sharing agreement

Using curl

curl https://{subdomain}.zendesk.com/api/v2/sharing_agreements/{sharing_agreement_id}.json \  -X DELETE -v -u {email_address}:{password}

Example Response

Status 204 No Content