Sharing Agreements

JSON Format

Sharing Agreements have the following format:

Name Type Comment
id integer Automatically assigned upon creation
name string Name of this sharing agreement
type string Can be one of the following: 'inbound', 'outbound'
status string Can be one of the following: 'accepted', 'declined', 'pending', 'inactive'
partner_name string Can be one of the following: 'jira', null
remote_subdomain string Subdomain of the remote account or null if not associated with an account
created_at date The time the record was created
Example
{
  "id":         88335,
  "url":        "https://company.zendesk.com/api/v2/agreements/88335.json",
  "name":       "Ticket Sharing",
  "type":       "inbound",
  "status":     "accepted",
  "created_at": "2012-02-20T22:55:29Z"
}

Show a Sharing Agreement

GET /api/v2/sharing_agreements/{id}.json

Returns a sharing agreement for your account.

Allowed for
  • Agents
Using curl
curl https://{subdomain}.zendesk.com/api/v2/sharing_agreements/{id}.json \
  -v -u {email_address}:{password}
Example Response
Status: 200 OK

{
  "sharing_agreement": {
    "id":    1,
    "name":  "Foo @ Zendesk",
    "type":  "inbound",
    ...
  }
}

List Sharing Agreements

GET /api/v2/sharing_agreements.json

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": [
    {
      "id":    1,
      "name":  "Foo @ Zendesk",
      "type":  "inbound",
      ...
     },
     ...
  ]
}

Create Sharing Agreement

POST /api/v2/sharing_agreements.json

Allowed for
  • Agents
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
Location: https://{subdomain}.zendesk.com/api/v2/sharing_agreements/{id}.json

{
  "sharing_agreement": {
    "id":    1,
    "name":  "Foo @ Zendesk",
    "type":  "inbound",
    ...
  }
}

Update a Sharing Agreement

PUT /api/v2/sharing_agreements/{id}.json

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

Allowed for
  • Agents
Using curl
curl https://{subdomain}.zendesk.com/api/v2/sharing_agreements/{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": {
    "id":    1,
    "name":  "Foo @ Zendesk",
    "type":  "inbound",
    ...
  }
}

Delete a Sharing Agreement

DELETE /api/v2/sharing_agreements/{id}.json

Deletes a sharing agreement.

Allowed for
  • Agents
Using curl
curl https://{subdomain}.zendesk.com/api/v2/sharing_agreements/{id}.json \
  -X DELETE -v -u {email_address}:{password}
Example Response
Status: 204 No Content