A ticket represents a customer request for support. The tickets endpoints allow you to manage this data and sync it between HubSpot and other systems.
POST
request to /crm/v3/objects/tickets
.
In your request, include your ticket data in a properties object. You can also add an associations object to associate your new ticket with existing records (e.g., contacts, companies), or activities (e.g., meetings, notes).
subject
(the ticket’s name), hs_pipeline_stage
(the ticket’s status) and if you have multiple pipelines, hs_pipeline
. If a pipeline isn’t specified, the default pipeline will be used.
To view all available properties, you can retrieve a list of your account’s ticket properties by making a GET
request to /crm/v3/properties/tickets
. Learn more about the the properties API.
Parameter | Description |
---|---|
to | The record or activity you want to associate with the ticket, specified by its unique id value. |
types | The type of the association between the ticket and the record/activity. Include the associationCategory and associationTypeId . Default association type IDs are listed here, or you can retrieve the value for custom association types (i.e. labels) via the associations API. |
GET
request to /crm/v3/objects/tickets/{ticketId}
.GET
request to /crm/v3/objects/tickets
.Parameter | Description |
---|---|
properties | A comma separated list of the properties to be returned in the response. If a requested property isn’t defined, it won’t be included in the response. If a requested property is defined but a ticket doesn’t have a value, it will be returned as null . |
propertiesWithHistory | A comma separated list of the current and historical properties to be returned in the response. If a requested property isn’t defined, it won’t be included in the response. If a requested property is defined but a ticket doesn’t have a value, it will be returned as null . |
associations | A comma separated list of objects to retrieve associated IDs for. Any specified associations that don’t exist will not be returned in the response. Learn more about the associations API. |
POST
request to crm/v3/objects/tickets/batch/read
. The batch endpoint cannot retrieve associations. Learn how to batch read associations with the associations API.idProperty
parameter to retrieve tickets by a custom unique identifier property. By default, the id
values in the request refer to the record ID (hs_object_id
), so the idProperty
parameter is not required when retrieving by record ID. To use a custom unique value property to retrieve tickets, you must include the idProperty
parameter.
For example, to retrieve a batch of tickets, your request could look like either of the following:
To retrieve tickets with current and historical values for a property, your request could look like:
PATCH
request to /crm/v3/objects/tickets/{ticketId}
, and include the data you want to update.POST
request to /crm/v3/objects/tickets/batch/update
. In the request body, include an array with the identifiers for the tickets and the properties you want to update.PUT
request to /crm/v3/objects/tickets/{ticketId}/associations/{toObjectType}/{toObjectId}/{associationTypeId}
.
associationTypeId
value, refer to this list of default values, or make a GET
request to /crm/v4/associations/{fromObjectType}/{toObjectType}/labels
.DELETE
request to the following URL: /crm/v3/objects/tickets/{ticketId}/associations/{toObjectType}/{toObjectId}/{associationTypeId}
.
hs_pinned_engagement_id
field in your request. In the field, include the id
of the activity to pin, which can be retrieved via the engagements APIs. You can pin one activity per record, and the activity must already be associated with the ticket prior to pinning.
To set or update a ticket’s pinned activity, your request could look like:
DELETE
request to /crm/v3/objects/tickets/{ticketId}
.
Learn more about deleting tickets in the reference documentation.