Overview
The freshservice API
Freshservice's APIs belong to the REpresentational State Transfer (REST) category. This allows you to perform "RESTful" operations like read, modify, add or delete data from your service desk.
What can I do with the freshservice API?
With the APIs, you can
Read
- Browse through tickets, users - their details and satisfaction ratings.
- Apply Filters and get only the data that you want
Write
- Create new tickets or users and modify the details of existing ones.
- Create solutions and answer FAQs.
Support
- Carry on conversations about a ticket using public or private notes.
- Assign tickets to the right people for the job.
- Collaborate with fellow agents via "Private Notes" in a ticket.
- Escalate unsolved problems.
API Endpoints and SSL
API endpoints are mapped to your account domain:
https://domain.freshservice.com/path/to/api.json
If you have disabled ssl under admin settings for your freshservice domain, your API calls must point to the normal endpoint—simply change the https:// part of the endpoint to http://.
http://domain.freshservice.com/path/to/api.json
For brevity, all further references in document relating to API endpoints will use the default https.
Authentication
How does it work? Who can access my helpdesk? Can everybody see my data?
"Thou shall not pass." Unless you authenticate your ID
Before you can set the priority of a ticket or change a customer's name or use any of the APIs listed above, you need to "authenticate your ID" or "login" in the same way as you login into your helpdesk's web portal.
Freshservice uses Basic Access Authorization. This means, for authentication, you can use the same username and password you use when logging into your helpdesk. Or, you can use your personal API key provided by us. If you use the API Key, there is no need for any password. You can use any set of characters as a dummy password.
curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET https://domain.freshservice.com/helpdesk/tickets.json
curl -u apikey:X -H "Content-Type: application/json" -X GET https://domain.freshservice.com/helpdesk/tickets.json
Note:
If you are sure that your password and username are correct, but are still unable to access your helpdesk, make sure that your "username:password" (or "APIkey:X") is Base64-encoded before passing it as an "Authorization" header.
Where can I find my API key?
- Login to your Support Portal
- Click on your profile picture on the top right corner of your portal
- Go to Profile settings Page
- Your API key will be available below the change password section to your right
How do I access the information? What are the resources available via the API?
Every single piece of information or data - be it a customer's ID or the priority of a specific ticket - can be identified by its own unique identifier or "URI". If you want your data from the helpdesk, whether via your smartphone app or via a third party service, you need this identifier. All URIs follow a specific format and that format is:
https://your_helpdesk_domain_name/resource_name
For example: If you are Davy Jones and you are managing the drowned souls and their problems via your freshservice portal "thelocker.freshservice.com", then to access contacts in your helpdesk, the syntax would be
https://www.thelocker.freshservice.com/itil/requesters.json
For tickets, it would be
https://www.thelocker.freshservice.com/helpdesk/tickets.json
Note:
We have shortened API resource URL throughout this document. Prefix your support domain name to the resource handle.
Example:
/helpdesk/tickets is actually https://yourdomain.freshservice.com/helpdesk/tickets
What API commands are used by freshservice?
Freshservice APIs have been implemented as plain JSON over HTTP and use the following REST Commands:
Command | Purpose |
---|---|
POST | Create one or more items |
GET | Fetch one or more items |
PUT | Update one or more existing items |
DELETE | Remove one or more items that already exist |
Will everyone have the same access rights?
No, everyone will not have the same access rights. Your ability to access data depends on the permissions available for your freshservice profile. If your freshservice Agent Role is "Newbie Agent" who is not allowed to answer to tickets, but is only allowed to view them, then the APIs will restrict you from answering and you'll only be able to view the tickets.
Rate Limit
The number of API calls per hour is restricted to 1000. If your API request is received after the limit has been reached, freshservice will give you an error response. The "retry-after" value in the response header will tell you how long you need to wait before you send another API request.
Response HTTP STATUS: HTTP 403 Forbidden Headers: "Retry-After": <seconds>
Please contact support@freshservice.com for further queries.
Pagination
Responses for API that return a list, like ticket listing and requester listing, are paginated. To scroll through the responses, add GET request parameter page=[number] to your request. Page number starts with 1.
Ticket
This section lists all API that can be used to create, edit or otherwise manipulate tickets. If you wish to create Tags to better identify tickets, this section also lists the APIs for creating and manipulating those tags.
Attribute | Type | Description |
---|---|---|
display_id | number | Ticket ID specific to your account Read-Only |
string | Email address of the requester. If no contact exists with this email address in freshservice, it will be added as a new contact Mandatory | |
requester_id | number | User-id of the requester. For existing contacts, requester_id can be passed instead of email |
assoc_problem_id | number | id of the associated problem to the ticket |
assoc_change_id | number | id of the change initiating the ticket |
assoc_change_cause_id | number | id of the change causing the ticket |
assoc_asset_id | number | id of the asset associated to the ticket |
subject | string | Ticket subject |
description | string | Plain text content of the ticket |
description_html | string | HTML content of the ticket. Description and description_html should not be passed together Mandatory |
status * | number | Status of the ticket |
priority * | number | Priority of the ticket |
source * | number | The channel through which the ticket was created |
deleted | boolean | Set as true if the ticket is deleted/trashed. Deleted tickets will not be considered in any views except "deleted" filter |
spam | boolean | Set as true if the ticket is marked as spam |
responder_id | number | ID of the agent to whom the ticket is assigned |
group_id | number | Id of Group to which the ticket is assigned |
ticket_type | number | Type property field as defined in ticket fields |
to_email | array of strings | Email address to which the incoming ticket email was sent |
cc_email | array of strings | Email address added in the 'cc' field of the incoming ticket email |
email_config_id | number | Id of email config which is used for this ticket (i.e., support@yourcompany.com/sales@yourcompany.com) |
isescalated | boolean | Set to true if an escalation was sent |
due_by | datetime | Ticket due-by time |
id | number | unique ID of the ticket Read-Only |
attachments | array of objects | Attached files of the ticket Read-Only |
category | string | Ticket category |
sub_category | string | Ticket sub category |
item_category | string | Ticket item category |
* Refer Ticket properties table for supported values. |
Note/Conversations Attributes
Attribute | Type | Description |
---|---|---|
Id | number | Id of the note Read-Only |
body | string | Content of the note in plain text |
body_html | string | Content of the note in HTML format. Either body or body_html has to be passed Mandatory |
attachments | - | Attachments associated with the note Read-Only |
user_id | number | user_id of the agent who is adding the note |
private | boolean | Set as true if the note is private |
to_emails | array of strings | Array of agent email addresses, who need to be notified |
deleted | boolean | Set to true if a particular note is deleted |
Ticket Properties
With every ticket having certain fixed values to denote Source, State and Priorities, the numerical value for each state (open, closed, from email, from portal etc.) is given below
Source Type | Value |
---|---|
1 | |
Portal | 2 |
Phone | 3 |
Chat | 4 |
Status | Value |
---|---|
Open | 2 |
Pending | 3 |
Resolved | 4 |
Closed | 5 |
Priorities | Value |
---|---|
Low | 1 |
Medium | 2 |
High | 3 |
Urgent | 4 |
Create a Ticket
This API helps you to create a new ticket in your service desk.
1 2 3 4 5 6 7 8 9 | { "helpdesk_ticket":{ "description":"Some details on the issue ...", "subject":"Support needed..", "email":"hulk@outerspace.com", "priority":1, "status":2, "source":2,"ticket_type":"Incident" }, "cc_emails":"superman@marvel.com,avengers@marvel.com" } |
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -d '{ "helpdesk_ticket": { "description": "Details about the issue...", "subject": "Support Needed...", "email": "tom@outerspace.com", "priority": 1, "status": 2 }, "cc_emails": "ram@freshservice.com,diana@freshservice.com" }' -X POST https://domain.freshservice.com/helpdesk/tickets.json |
Create Ticket with attachment
This API helps you to create a new ticket in your help desk with attachments.
Note:
The API request must be sent as multipart/form-data content-type.
1 | curl -v -u user@yourcompany.com:test -F "helpdesk_ticket[attachments][][resource]=@/path/to/attachment1.ext" -F "helpdesk_ticket[attachments][][resource]=@/path/to/attachment2.ext" -F "helpdesk_ticket[email]=example@example.com" -F "helpdesk_ticket[subject]=Ticket Title" -F "helpdesk_ticket[description]=this is a sample ticket" -X POST https://domain.freshservice.com/helpdesk/tickets.json |
View a Ticket
This API lets you retrieve and view a specific ticket and all conversations related to it in your service desk.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET https://domain.freshservice.com/helpdesk/tickets/1.json |
View list of Tickets
This API helps you to view the tickets in your service desk.
To view only specific tickets (that is, those which match only the criteria you choose) use the filters given below.
Note:
All the below requests are paginated to return only 30 tickets per page. Append the parameter "page=[:page_no]" in the url to traverse through pages.
Filter by | Handle |
---|---|
Default filters: | /helpdesk/tickets/filter/[filter_name]?format=json The various filters available are all_tickets, new_my_open, monitored_by, spam, deleted |
Requester | /helpdesk/tickets/filter/requester/[requester_id]?format=json |
Custom ticket views | /helpdesk/tickets/view/[view_id]?format=json |
Requester email | /helpdesk/tickets.json?email=[email]&filter_name=all_tickets |
View All Tickets | helpdesk/tickets.json |
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET https://domain.freshservice.com/helpdesk/tickets/filter/all_tickets?format=json&page=1 |
Update a Ticket
This API lets you make changes to the parameters of a ticket from updating statuses to changing ticket type.
1 2 3 4 5 6 7 8 9 | { "helpdesk_ticket": { "priority":1, "status":2, "custom_field":{ "weapon_1":"Laser Gun" } } } |
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X PUT -d '{ "helpdesk_ticket": { "priority":1, "status":2 }}' https://domain.freshservice.com/helpdesk/tickets/1.json |
Delete a Ticket
This API helps you delete a ticket.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X DELETE https://domain.freshservice.com/helpdesk/tickets/1.json |
Get all Ticket Fields
This API lets you view the fields in a ticket.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET https://domain.freshservice.com/ticket_fields.json |
Add note to a Ticket
If you wish to add notes to a ticket - private or public - this API lets you do so. Any note that you add using this API, by default, is Private. If you wish a public note, set the
1 2 3 4 5 6 | { "helpdesk_note": { "body":"Hi tom, Still Angry", "private":false } } |
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X POST -d '{ "helpdesk_note": { "body":"Hi tom, Still Angry", "private":false }}' https://domain.freshservice.com/helpdesk/tickets/141/conversations/note.json |
Add note with attachment
Use this API to create notes with attachment.
Note:
The API request must be sent as multipart/form-data content-type.
1 | curl -v -u user@yourcompany.com:test -F "helpdesk_note[attachments][][resource]=@/path/to/attachment1.ext" -F "helpdesk_note[body]=Note content" -F "helpdesk_note[private]=false" -X POST https://domain.freshservice.com/helpdesk/tickets/[id]/conversations/note.json |
Associate a CI/Asset to a Ticket
This API helps you associate an asset to a ticket in your service desk.
1 2 3 4 5 6 7 8 9 10 | { "helpdesk_ticket":{ "description":"Some details on the issue ...", "subject":"Support needed..", "email":"hulk@outerspace.com", "priority":1, "status":2, "source":2,"ticket_type":"Incident" }, "associate_ci":{"serial_no":"ABC12345","name":"my printer","user":"rachel@freshdesk.com"}, "cc_emails":"superman@marvel.com,avengers@marvel.com" } |
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -d '{ "helpdesk_ticket": { "description": "Details about the issue...", "subject": "Support Needed...", "email": "tom@outerspace.com", "priority": 1, "status": 2 }, "associate_ci":{"serial_no":"ABC12345","name":"my printer","user":"rachel@freshdesk.com"} }' -X POST https://domain.freshservice.com/helpdesk/tickets.json |
Problem
This section lists all API that can be used to create, edit or otherwise manipulate problems. You can also create filters to sift through problems.
Attribute | Type | Description |
---|---|---|
display_id | number | Problem ID specific to your account Read-Only |
string | Email address of the requester. If no contact exists with this email address in freshservice, it will be added as a new contact Mandatory | |
requester_id | number | User-id of the requester. For existing contacts, requester_id can be passed instead of email |
assoc_change_id | number | id of the associated change to the problem |
subject | string | Problem subject |
description | string | Plain text content of the problem |
description_html | string | HTML content of the problem. Description and description_html should not be passed together Mandatory |
status * | number | Status of the problem |
priority * | number | Priority of the problem |
impact * | number | Impact of the problem |
deleted | boolean | Set as true if the problem is deleted/trashed. Deleted problems will not be considered in any views except "deleted" filter |
owner_id | number | Id of the agent to whom the problem is assigned |
group_id | number | Id of Group to which the problem is assigned |
due_by | datetime | Problem due-by time |
id | number | unique ID of the problem Read-Only |
attachments | array of objects | Attached files of the problem Read-Only |
category | string | Problem category |
sub_category | string | Problem sub category |
item_category | string | Problem item category |
* Refer Problem properties table for supported values. |
Note/Conversations Attributes
Attribute | Type | Description |
---|---|---|
Id | number | Id of the note Read-Only |
body | string | Content of the note in plain text |
body_html | string | Content of the note in HTML format. Either body or body_html has to be passed Mandatory |
attachments | - | Attachments associated with the note Read-Only |
user_id | number | user_id of the agent who is adding the note |
to_emails | array of strings | Array of agent email addresses, who need to be notified |
deleted | boolean | Set to true if a particular note is deleted |
Problem Properties
With every problem having certain fixed values to denote Source, State and Priorities, the numerical value for each state (open, closed etc.) is given below
Priority | Value |
---|---|
Low | 1 |
Medium | 2 |
High | 3 |
Urgent | 4 |
Status | Value |
---|---|
Open | 1 |
Pending | 2 |
Resolved | 3 |
Closed | 4 |
Impact | Value |
---|---|
Low | 1 |
Medium | 2 |
High | 3 |
Create a Problem
This API helps you to create a new problem in your service desk.
1 2 3 4 5 6 7 8 9 10 | { "itil_problem":{ "subject":"change needed..", "email":"hulk@outerspace.com", "priority":1, "status":1, "impact":1, "custom_field_attributes":{ "problem_range_1":"serious" } } } |
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -d '{ "itil_problem": { "subject": "Support Needed...", "email": "hulk@outerspace.com", "priority": 1, "status": 1,"impact":1,"custom_field_attributes":{"problem_range_1":"serious"},"cmdb_requests_attributes":{"item_ids":"1"} }}' -X POST https://domain.freshservice.com/itil/problems.json |
View a Problem
This API lets you retrieve and view a specific problem and all conversations related to it in your service desk.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET https://domain.freshservice.com/itil/problems/17.json |
View list of Problems
This API helps you to view all the problems in your service desk.
To view only specific problems (that is, those which match only the criteria you choose) use the filters given below.
Note:
All the below requests are paginated to return only 30 problems per page. Append the parameter "page=[:page_no]" in the url to traverse through pages.
Filter by | Handle |
---|---|
Default filters: | /itil/problems/filter/[filter_name]?format=json The various filters available are all,new_my_open and deleted |
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET https://domain.freshservice.com/itil/problem/filter/all?format=json&page=1 |
Update a Problem
This API lets you make changes to the parameters of a problem from updating statuses to changing problem type.
1 2 3 4 5 6 7 8 9 10 | { "itil_problem": { "priority":4, "status":3, "impact":3, "custom_field_attributes":{ "problem_range_1":"serious" } } } |
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X PUT -d '{ "itil_problem": { "priority":4, "status":3, "impact":3,"custom_field_attributes":{"problem_range_1":"serious"} }}' https://domain.freshservice.com/itil/problems/17.json |
Delete a Problem
This API helps you delete a problem.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X DELETE https://domain.freshservice.com/itil/problems/17.json |
Get all Problem Fields
This API lets you view the fields in a problem.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET https://domain.freshservice.com/itil/problem_fields.json |
Add note to a Problem
If you wish to add notes to a problem
1 2 3 4 5 | { "itil_note": { "body":"Hi Hulk, Still Angry" } } |
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X POST -d '{ "itil_note": { "body":"Hi Hulk, Still Angry"}}' https://domain.freshservice.com/itil/problems/17/notes.json |
Detach Asset from a Problem
This API lets you to detach the associated assets from a problem
1 2 3 4 5 | { "itil_problem": { "asset_ids": [1, 2] } } |
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -d '{ "itil_problem": {"asset_ids": [1, 2] }}' -X PUT https://domain.freshservice.com/itil/problems/1/detach_ci.json |
Change
This section lists all API that can be used to create, edit or otherwise manipulate changes. You can create filters to sift through changes and to find the ones you want.
Attribute | Type | Description |
---|---|---|
display_id | number | Change ID specific to your account Read-Only |
string | Email address of the requester. If no contact exists with this email address in freshservice, it will be added as a new contact Mandatory | |
requester_id | number | User-id of the requester. For existing contacts, requester_id can be passed instead of email |
assoc_release_id | number | id of the associated change to the change |
subject | string | change subject |
description | string | Plain text content of the change |
description_html | string | HTML content of the change. Description and description_html should not be passed together Mandatory |
status * | number | Status of the change |
priority * | number | Priority of the change |
impact * | number | Impact of the change |
risk * | number | Risk of the change |
change type * | number | type of the change |
approval_status | number | Approval status of the change |
planned_start_date | datetime | Planned Start date |
planned_end_date | datetime | Planned End date |
deleted | boolean | Set as true if the change is deleted/trashed. Deleted changes will not be considered in any views except "deleted" filter |
owner_id | number | Id of the agent to whom the change is assigned |
group_id | number | Id of Group to which the change is assigned |
id | number | unique ID of the change Read-Only |
attachments | array of objects | Attached files of the change Read-Only |
category | string | Change category |
sub_category | string | Change sub category |
item_category | string | Change item category |
* Refer change properties table for supported values. |
Note/Conversations Attributes
Attribute | Type | Description |
---|---|---|
Id | number | Id of the note Read-Only |
body | string | Content of the note in plain text |
body_html | string | Content of the note in HTML format. Either body or body_html has to be passed Mandatory |
attachments | - | Attachments associated with the note Read-Only |
user_id | number | user_id of the agent who is adding the note |
to_emails | array of strings | Array of agent email addresses, who need to be notified |
deleted | boolean | Set to true if a particular note is deleted |
Change Properties
With every change having certain fixed values to denote Source, State and Priorities, the numerical value for each state (open, closed etc.) is given below
Status | Value |
---|---|
Open | 1 |
Planning | 2 |
Approval | 3 |
Pending Release | 4 |
Pending Review | 5 |
closed | 6 |
Priority | Value |
---|---|
Low | 1 |
Medium | 2 |
High | 3 |
Urgent | 4 |
Impact | Value |
---|---|
Low | 1 |
Medium | 2 |
High | 3 |
Change Type | Value |
---|---|
Minor | 1 |
Standard | 2 |
Major | 3 |
Emergency | 4 |
Risk | Value |
---|---|
Low | 1 |
Medium | 2 |
High | 3 |
Very High | 4 |
Create a Change
This API helps you to create a new change in your service desk.
1 2 3 4 5 6 7 8 9 10 | { "itil_change":{ "subject":"change for support", "email":"hulk@outerspace.com", "priority":1, "status":1,"change_type":1,"impact":1,"risk":1, "custom_field_attributes":{ "change_range_1":"normal" } } } |
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -d '{ "itil_change": { "subject": "change for support", "email": "hulk@outerspace.com", "priority":1,"status":1,"risk":1,"impact":1,"change_type":1,"custom_field_attributes":{"change_range_1":"normal"},"cmdb_requests_attributes":{"item_ids":"1"}}}' -X POST https://domain.freshservice.com/itil/changes.json |
View a Change
This API lets you retrieve and view a specific change and all conversations related to it in your service desk.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET https://domain.freshservice.com/itil/changes/3.json |
View list of Changes
This API helps you to view all the changes in your service desk.
To view only specific changes (that is, those which match only the criteria you choose) use the filters given below.
Note:
All the below requests are paginated to return only 30 changes per page. Append the parameter "page=[:page_no]" in the url to traverse through pages.
Filter by | Handle |
---|---|
Default filters: | /itil/changes/filter/[filter_name]?format=json The various filters available are all,new_my_open and deleted |
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET https://domain.freshservice.com/itil/changes/filter/all?format=json&page=1 |
Update a Change
This API lets you make changes to the parameters of a change from updating statuses to changing priority.
1 2 3 4 5 6 7 8 9 10 | { "itil_change":{ "priority":2, "status":2, "impact":2, "custom_field_attributes":{ "change_range_1":"normal" } } } |
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X PUT -d '{ "itil_change":{"priority":2,"status":2,"impact":2,"custom_field_attributes":{"change_range_1":"normal"} }}'https://domain.freshservice.com/itil/changes/3.json |
Delete a Change
This API helps you delete a change.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X DELETE https://domain.freshservice.com/itil/changes/3.json |
Get all Change Fields
This API lets you view the fields in a change.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET https://domain.freshservice.com/itil/change_fields.json |
Add note to a Change
If you wish to add notes to a change
1 2 3 4 5 | { "itil_note": { "body":"Hi Hulk, Still Angry" } } |
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X POST -d '{ "itil_note": { "body":"Hi Hulk, Still Angry"}}' https://domain.freshservice.com/itil/changes/17/notes.json |
Detach Asset from a Change
This API lets you to detach the associated assets from a change
1 2 3 4 5 | { "itil_change": { "asset_ids": [1, 2] } } |
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -d '{ "itil_change": {"asset_ids": [1, 2] }}' -X PUT https://domain.freshservice.com/itil/changes/1/detach_ci.json |
Release
This section lists all API that can be used to create, edit or otherwise manipulate releases. You can create filters to sift through releases.
Attribute | Type | Description |
---|---|---|
display_id | number | Release ID specific to your account Read-Only |
string | Email address of the requester. If no contact exists with this email address in freshservice, it will be added as a new contact Mandatory | |
requester_id | number | User-id of the requester. For existing contacts, requester_id can be passed instead of email |
subject | string | Release subject |
description | string | Plain text content of the release |
description_html | string | HTML content of the release. Description and description_html should not be passed together Mandatory |
status * | number | Status of the release |
priority * | number | Priority of the release |
release_type * | number | Type of the release |
approval_status | number | Approval status of the release |
planned_start_date | datetime | Planned start date |
planned_end_date | datetime | Planned end date |
work_start_date | datetime | actual start date |
work_end_date | datetime | actual end date |
deleted | boolean | Set as true if the release is deleted/trashed. Deleted releases will not be considered in any views except "deleted" filter |
owner_id | number | Id of the agent to whom the release is assigned |
group_id | number | Id of Group to which the release is assigned |
id | number | unique ID of the release Read-Only |
attachments | array of objects | Attached files of the release Read-Only |
category | string | Release category |
sub_category | string | Release sub category |
item_category | string | Release item category |
* Refer release properties table for supported values. |
Note/Conversations Attributes
Attribute | Type | Description |
---|---|---|
Id | number | Id of the note Read-Only |
body | string | Content of the note in plain text |
body_html | string | Content of the note in HTML format. Either body or body_html has to be passed Mandatory |
attachments | - | Attachments associated with the note Read-Only |
user_id | number | user_id of the agent who is adding the note |
to_emails | array of strings | Array of agent email addresses, who need to be notified |
deleted | boolean | Set to true if a particular note is deleted |
Release Properties
With every release having certain fixed values to denote Source, State and release type, the numerical value for each state (open, closed etc.) is given below
Status | Value |
---|---|
Open | 2 |
Onhold | 3 |
Inprogress | 4 |
Incomplete | 5 |
completed | 6 |
Priority | Value |
---|---|
Low | 1 |
Medium | 2 |
High | 3 |
Urgent | 4 |
Release Type | Value |
---|---|
Minor | 1 |
Standard | 2 |
Major | 3 |
Emergency | 4 |
Create a Release
This API helps you to create a new release in your service desk.
1 2 3 4 5 6 7 8 9 10 | { "itil_release":{ "subject":"release for support", "priority":1, "status":2,"release_type":1 "custom_field_attributes":{ "release_range_1":"normal" }, "cc_emails":"superman@marvel.com,avengers@marvel.com" } } |
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -d '{ "itil_release": { "subject": "Release for support.", "email": "hulk@outerspace.com", "priority": 1, "status": 2,"release_type":1,"custom_field_attributes":{"release_range_1":"normal"},"cmdb_requests_attributes":{"item_ids":"1"} }}' -X POST https://domain.freshservice.com/itil/releases.json |
View a Release
This API lets you retrieve and view a specific release and all conversations related to it in your service desk.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET https://domain.freshservice.com/itil/releases/11.json |
View list of Releases
This API helps you to view all the releases in your service desk.
To view only specific releases (that is, those which match only the criteria you choose) use the filters given below.
Note:
All the below requests are paginated to return only 30 releases per page. Append the parameter "page=[:page_no]" in the url to traverse through pages.
Filter by | Handle |
---|---|
Default filters: | /itil/releases/filter/[filter_name]?format=json The various filters available are all,new_my_open and deleted |
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET https://domain.freshservice.com/itil/releases/filter/all?format=json&page=1 |
Update a Release
This API lets you make changes to the parameters of a releses from updating statuses to changing release priority.
1 2 3 4 5 6 | { "itil_release": { "priority":2, "status":3 } } |
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X PUT -d '{ "itil_release": { "priority":2, "status":3 }}' https://domain.freshservice.com/itil/releases/11.json |
Delete a Release
This API helps you delete a release.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X DELETE https://domain.freshservice.com/itil/releases/11.json |
Get all Release Fields
This API lets you view the fields in a release.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET https://domain.freshservice.com/itil/release_fields.json |
Add note to a Release
If you wish to add notes to a release
1 2 3 4 5 | { "itil_note": { "body":"Hi Hulk, Still Angry" } } |
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X POST -d '{ "itil_note": { "body":"Hi Hulk, Still Angry"}}' https://domain.freshservice.com/itil/releases/17/notes.json |
Detach Asset from a Release
This API lets you to detach the associated assets from a release
1 2 3 4 5 | { "itil_release": { "asset_ids": [1, 2] } } |
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -d '{ "itil_release": {"asset_ids": [1, 2] }}' -X PUT https://domain.freshservice.com/itil/releases/1/detach_ci.json |
Time Entries
These APIs help you track exactly how much time you've spent on each ticket*, start/stop timers and perform a whole other lot of time tracking and monitoring tasks to ensure that your support team is always performing at peak efficiency.
* - You can use any of the modules here - incident, problem, change or release.
Attribute | Type | Description |
---|---|---|
id | number | Id of the time entry Read-Only |
executed_at | datetime | Time at which this time-entry id added/created |
billable | boolean | Set as true if the entry is billable |
note | string | Description on this time-entry |
start_time | datetime | The time at which the time-entry is added or the time of the last invoked "start-timer" action using a toggle |
timer_running | boolean | Set to true if the start-timer is invoked and is currently running. |
hhmm | string | The number of hours (in hh:mm format). Used to set the total time_spent. If this property is set via update call the timer_running will be stopped and reset to the passed value |
ticket_id* | number | The ID of the ticket* to which this time-entry is associated. Id is passed as part of the handle url Read-Only |
user_id | number | The user/agent to whom this time-entry is associated Mandatory |
agent_name | string | System fills the agent name in the response from the above user_id Read-Only |
agent_email | string | The agent email in the response from the above user_id Read-Only |
Note:
1. * - You can use any of the modules here - incident, problem, change or release.
2. {module_name} - You can use any of the modules here - tickets, problems, changes or releases.
Create Time Entry
This API helps you create a Time Entry.
Note:
1. If you don't specify in the API command, the timer-running attribute will be set to 'true' and the activities will get clocked once the timesheet is created.
1 2 3 4 5 6 7 8 | { "time_entry": { "note":"test_entry", "hhmm":"03:00", "user_id":"1", "billable":"true" } } |
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X POST -d '{"time_entry":{"note":"test_entry","hhmm":"03:00","user_id":"1","billable":"true"}}' https://domain.freshservice.com/itil/tickets/44/time_sheets.json |
View By Module Time Entry
To view existing Time Entries, use this API.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET https://domain.freshservice.com/itil/tickets/44/time_sheets.json |
Update Time Entry
You can use this API to update/modify existing time entries.
1 2 3 4 5 6 | { "time_entry": { "note":"test_entry_update", "billable":"false" } } |
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X PUT -d '{"time_entry":{"note":"test_entry_update","billable":"false"}}' https://domain.freshservice.com/itil/tickets/44/time_sheets/33.json |
Start/Stop Timer
This API helps you start or stop the timer.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X PUT https://domain.freshservice.com/itil/tickets/44/time_sheets/33/toggle_timer.json |
Delete Time Entry
You can use this API to delete an existing Time Entry. You cannot restore deleted time entries.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X DELETE https://domain.freshservice.com/itil/tickets/44/time_sheets/33.json |
Tasks
These APIs let you manage tasks within modules, right from creating new tasks to updating and even deleting them.
* - You can use any of the modules here - incident, problem, change or release.
Attribute | Type | Description |
---|---|---|
id | number | Id of the time entry Read-Only |
owner_id | number | user_id of the assigned agent |
status | number | Status of the task |
due_date | datetime | Due date of the task |
notify_before | number | Time before the due_date at which agent should be notified |
deleted | boolean | set to true if the task is deleted.Read-Only |
title | string | title of the task Mandatory |
description | string | description of the task |
group_id | number | id of the group assigned to the task |
ticket_id | number | id of the ticket to which the task is associated. Read-Only |
user_id | number | id of the user creating the task. Read-Only |
TASK PROPERTIES
With every task having certain fixed values to denote the ‘notify before’ time and status, the equivalent values are given below
NOTIFY BEFORE | VALUE |
---|---|
never | never |
15 minutes | fifteen |
30 minutes | thirty |
45 minutes | fortyfive |
1 hour | onehour |
2 hours | twohour |
STATUS | VALUE |
---|---|
open | 1 |
inprogress | 2 |
completed | 3 |
Note:
1. * - You can use any of the modules here - incident, problem, change or release.
2. {module_name} - You can use any of the modules here - tickets, problems, changes or releases.
Create a Task
This API helps you create tasks for tickets, problems, changes and releases in your service desk.
1 2 3 4 5 6 7 8 9 10 11 | { "it_task":{ "title":"Supply lightsabers to all the Jedis", "description":"We need to re-supply to win the war!.", "group_id":"5", "owner_id":"3", "due_date":"2015-01-06 09:41:20", "status":"1", "notify_before":"fifteen" } } |
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X POST -d '{"it_task":{"title":"Supply lightsabers to all the Jedis","description":"We need to re-supply to win the war!.","group_id":"5","owner_id":"3","due_date":"2015-01-06 09:41:20","status":"1","notify_before":"fifteen"}}' https://domain.freshservice.com/itil/tickets/2/it_tasks.json |
View My Tasks
This API helps you view all the tasks of the user currently logged in.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET -d https://domain.freshservice.com/itil/it_tasks.json |
View a Specific Task
This API helps you view a specific task within a particular module.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET -d https://domain.freshservice.com/itil/tickets/2/it_tasks/13.json |
View Task By Module Item
This API helps you view tasks from a particular module in your service desk.
1 2 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET -d https://domain.freshservice.com/itil/tickets/13/it_tasks.json |
Update a Task
This API helps you to update a particular task from the modules in your service desk.
1 2 3 4 5 6 7 8 9 10 | { "it_task":{ "title":"Supply medi-kits to all the base stations", "description":"This is very important!.", "owner_id":"5", "due_date":"2015-05-13 12:47:02", "status":"2", "notify_before":"thirty" } } |
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X PUT -d '{ "it_task":{"title":"Supply medi-kits to all the base stations","description":"This is very important!.","owner_id":"5","due_date":"2015-05-13 12:47:02","status":"2","notify_before":"thirty"}}' https://domain.freshservice.com/itil/tickets/2/it_tasks/13.json |
Delete a Task
This API helps you delete a particular task from the modules in your service desk.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X DELETE https://domain.freshservice.com/itil/tickets/14/it_tasks/13.json |
Agent
You can view agents information using the following APIs. Only users with admin privileges can access the following APIs.
Attribute | Type | Description |
---|---|---|
id | number | Id of an agent |
occasional | boolean | Set to true if occasional agent (true => occasional, false=> full-time ) |
signature_html | string | Signature of an agent in HTML format |
points | string | Points scored by an agent |
scoreboard_level_id | number | Scoreboard level id of an agent |
ticket_permission | number | Ticket permission given to an agent (1 -> Global Access, 2 -> Group Access, 3 -> Restricted Access)Deprecated |
user_id | number | User id of an agent |
user[name] | string | Name of an agent |
user[email] | string | Email id of an agent |
user[job_title] | string | Job Title of an agent |
user[phone] | number | Telephone number of an agent |
user[mobile] | number | Mobile number of an agent |
user[language] | string | Language of an agent. Default language is "en" |
user[time_zone] | string | Time zone of an agent |
user[helpdesk_agent] | boolean | Set to true for an agent |
View Agent
If you want to view a particular agent, this API can be used.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET https://domain.freshservice.com/agents/19.json |
View All Agent
If you want to view a list of agents, this API can be used.
To view only specific agents (that is, those which match only the criteria you choose) use filters.
Filter by | Handle |
---|---|
email, mobile, phone | /agents.json?query= <condition> Example: /agents.json?query=email is user@yourcompany.com [Note: Do an url encode of the query string and supports only is operator] |
state | /agents/filter/[state]?format=json i.e., [active/occasional] |
Only all active agents will be listed using "/agents.json" api. To view all occasional agents "/agents/filter/occasional?format=json" api can be used.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET https://domain.freshservice.com/agents.json |
User
You can create users, view and update user information using the following APIs
Attribute | Type | Description |
---|---|---|
id | number | Id of the user Read-Only |
name | string | Name of the user Mandatory |
email * | string | Email for the user Mandatory |
address | string | Address of the user |
description | string | A small description about the user |
job_title | string | Job Title of the user |
phone * | number | Telephone number of the user |
mobile * | number | Mobile number of the user |
language | string | Language of the user. Default language is "en" |
time_zone | string | Time zone of the user |
deleted | boolean | Set to true if the contacts is deleted |
helpdesk_agent | boolean | Indicates if the contact is an agent Read-Only |
active | boolean | Set to true if the user is verifiedRead-Only |
* Email, Phone or Mobile - one of three is mandatory to create an user. |
Create a User
This API helps you create new users. The Email and Name parameters are mandatory
1 2 3 4 5 6 7 8 9 | { "user":{ "name":"Super Man", "email":"ram@freshservice.com", "department_users_attributes":{ "department_id": "2,3" } } } |
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X POST -d '{ "user": { "name":"Super Man", "email":"ram@freshservice.com","department_users_attributes":{ "department_id": "2,3" } }}' https://domain.freshservice.com/itil/requesters.json |
View a User
If you want to view/spy/stalk a particular user, this API can be used.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET https://domain.freshservice.com/itil/requesters/19.json |
View list of Users
If you want to view a list of users, this API can be used.
To view only specific users (that is, those which match only the criteria you choose) use filters. All the below criterias can also be used in combinations
Filter by | Handle |
---|---|
email, mobile, phone | /itil/requesters.json?query=<condition> Example: /itil/requesters.json?query=email is user@yourcompany.com [Note: Do an url encode of the query string] |
state | /itil/requesters?state=[state] i.e., [verified/unverified/all/deleted] Note: |
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET https://domain.freshservice.com/itil/requesters.json |
Update a User
This API helps you modify the details of an existing user. For a list of all details that can be modified, view the table given above.
1 2 3 4 5 6 7 8 9 | { "user":{ "name":"Super Man", "email":"ram@freshservice.com", "department_users_attributes":{ "department_id": "5,6" } } } |
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X PUT -d '{ "user": { "name":"Super Man", "email":"ram@freshservice.com","department_users_attributes":{ "department_id": "5,6" } }}' https://domain.freshservice.com/itil/requesters/19.json |
Deactivate a User
This API lets you deactivate a user.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X DELETE https://domain.freshservice.com/itil/requesters/19.json |
Department
This section lists all API that can be used to create, edit or delete departments.
Attribute | Type | Description |
---|---|---|
id | number | Unique id of the department Read-Only |
name | string | Name of the department |
description | string | Description of the department |
head_id | number | id of the head_user |
prime_user_id | number | id of the prime_user |
domain_names | string | List of domain names associated with the department |
Create a Department
This API helps you to create a new department in your service desk.
1 2 3 4 5 6 7 8 9 10 | { "itil_department":{ "name":"SuperNova", "description":"Spaceship Manufacturing Company" "department_users_attributes":{ "head_id":"34", "domain_names":"supernova.com,supernova.acme.com" } } } |
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X POST -d '{ "itil_department":{ "name":"SuperNova", "description":"Spaceship Manufacturing Company", "head_id":"34"}}' https://domain.freshservice.com/itil/departments.json |
View a Department
This API lets you view a particular department.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET https://domain.freshservice.com/itil/departments/8.json |
View list of Departments
This API lets you view all the departments in your list.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET https://domain.freshservice.com/itil/departments.json |
Update a Department
This API lets you modify department details.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | { "itil_department":{ "name":"Super Nova", "description":"Space Shuttle Manufacturing", "department_user_attributes":{ "prime_user_id":"36", "domain_names":"supernova.co,supernova.acme.co", "custom_fields":{ "Product category": "shipping containers", "Transport medium" :"roadways" } } } } |
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X PUT -d '{ "itil_department": { "name":"Super Nova", "description":"Space Shuttle Manufacturing", "prime_user_id":"36"}}' https://domain.freshservice.com/itil/departments/8.json |
Delete a Department
This API lets you delete a department.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X DELETE https://domain.freshservice.com/itil/departments/8.json |
Asset
This section lists all API that can be used to create, edit or delete Assets.
Attribute | Type | Description |
---|---|---|
id | number | Unique id of the item Read-Only |
name | string | Name of the itemMandatory |
description | string | Description of the item |
ci_type_id | number | id of the item typeMandatory |
impact* | number | Impact of the item |
user_id | number | Id of the item_user |
department_id | number | Id of the associated department |
agent_id | number | Id of the associated agent |
assigned_on | datetime | Date at which the item is assigned |
deleted | number | Sets true if the item is deleted |
display_id | number | Display_id of the item |
root_id | number | Id of the ancestor |
location_id | string | Name of the location associated to the item |
asset_tag | string | Asset tag of the item |
Asset Properties
Each asset has a distinct property named impact for which the fixed values have been given below,Impact | Value |
---|---|
low | 1 |
medium | 2 |
high | 3 |
Create a Asset
This API helps you to create a new asset in your service desk.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | { "cmdb_config_item":{ "user_id":"214", "department_id":"4", "impact":"2", "location_id":"america", "assigned_on":"2014-07-18 03:54:18", "agent_id":"215", "asset_tag":"batch_2017", "name":"Windows 8", "ci_type_id":"3", "level_field_attributes":{ "product_3":"windows_os", "vendor_3":"microsoft", "cost":"8000", "license_validity_3":"24", "installation_date_3":"2014-07-24 13:33:35", "license_expiry_date_3":"2016-07-24 13:33:35", "license_key_3":"234-423-543-534", "version_3":"2.0", "license_type_3":"commercial", "installed_machine_3":"Andrea's laptop", "installation_path_3":"null", "last_audit_date_3":"2014-07-16 14:27:48" } } } |
1 | curl -u sample@freshservice.com:test -H "Content-Type: application/json" -d '{ "cmdb_config_item":{"user_id":"214","department_id":"4","impact":"2","location_id":"america","assigned_on":"2014-07-18 03:54:18","agent_id":"215","asset_tag":"batch_2017","name":"Windows 8","ci_type_id":"3","level_field_attributes":{"product_3":"windows_os","vendor_3":"microsoft","cost":"8000","license_validity_3":"24","installation_date_3":"2014-07-24 13:33:35","license_expiry_date_3":"2016-07-2413:33:35","license_key_3":"234-423-543-534","version_3":"2.0","license_type_3":"commercial","installed_machine_3":"Andrea's laptop","installation_path_3":"null","last_audit_date_3":"2014-07-16 14:27:48"}}}' -X POST https://domain.freshservice.com/cmdb/items.json |
Get All CI/Asset Types
This API helps you to fetch all the available config item types in your help desk.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET https://domain.freshservice.com/cmdb/ci_types .json |
Get All CI/Asset Type Fields
This API helps you to fetch all the config item type fields related to a particular config item type in your help desk.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET https://domain.freshservice.com/cmdb/ci_types/10 .json |
View a Asset
This API lets you view a particular asset.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET https://domain.freshservice.com/cmdb/items/113.json |
View list of Assets
This API lets you view all the assets in your list.
Note:
This request is paginated to return only 50 assets per page. Append the parameter "page=[:page_no]" in the url to traverse through pages.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET https://domain.freshservice.com/cmdb/items.json |
Update a Asset
This API lets you modify asset details.
1 2 3 4 5 6 7 8 | { "cmdb_config_item": { "name": "windows 7", "impact": "high", "asset_tag": "win7_1", "location_id":"Italy" } } |
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -d '{ "cmdb_config_item": { "name": "windows 7", "impact": "high","asset_tag": "win7_1","location_id":"Italy"}}' -X PUT https://domain.freshservice.com/cmdb/items/113.json |
Delete a Asset
This API lets you delete a asset.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X DELETE https://domain.freshservice.com/cmdb/items/16.json |
Restore a Asset
If you deleted or disabled some assets and regret doing so now, this API will help you restore them.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X PUT https://domain.freshservice.com/cmdb/items/16/restore.json |
Search Assets
This API lets you search for assets based on the some attributes.
Attribute | Type | Description |
---|---|---|
field_param | string | Specify the field which should be used to search for an asset.Mandatory Allowed Parameters : ‘name’ ‘asset_tag’ ‘serial_number’ |
query_param | string | Search textMandatory |
Note:
All the below requests are paginated to return only 25 results per page. Append the parameter "page=[:page_no]" in the url to traverse through pages.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET 'https://domain.freshservice.com/cmdb/items/list.json?field=name&q=andrea' |
Asset Relationships
This section lists all the APIs that can be used to perform operations related to Asset Relationships such as Creating, Deleting and Viewing relationships for an asset.
Attribute | Type | Description |
---|---|---|
id | number | Unique ID of an item |
type | string | Relationships can be created between an asset and a requester, agent, department or another asset. Allowed parameters: ‘requesters' -> to associate an asset to requesters 'agents' -> to associate an asset to agents ‘departments' -> to associate an asset to departments 'config_items' -> to associate an asset to another asset |
type_id | number | ID or list of IDs of the Requesters, Agents, Departments or Assets that is to be associated to an Asset. |
relationship_type_id | number | ID of the relationship type |
relationship_type | string | Indicates whether the relationship should be a forward or inverse relationship. Allowed parameters: ‘forward_relationship’ ‘backward_relationship’ |
relationship_id | number | Unique ID of a relationship |
List Relationship Types
This API lets you view the list of all the relationship types configured in your helpdesk. The id obtained in the response can then be used to create new relationships.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET https://domain.freshservice.com/cmdb/relationship_types/list.json |
Create a Relationship
This API lets you create a new relationship to an asset, requestor, agent or department
Note:
To link multiple items to an asset, provide comma separated strings (["1","2","3"]). Even for a single id the array is mandatory.
1 2 3 4 5 6 | { "type":"config_items", "type_id":["10","11"], "relationship_type_id":"2", "relationship_type":"forward_relationship" } |
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -d '{"type":"config_items", "type_id":["10"], "relationship_type_id":"2", "relationship_type":"forward_relationship"}' -X POST https://domain.freshservice.com/cmdb/items/1/associate.json |
Delete a Relationship
This API lets you delete an existing relationship of an asset.
Note:
The "relationship_id" param is the "id" of the relationship which is found either as a response after creating a relationship or from the View Relationships API
1 2 3 | { "relationship_id":"1" } |
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X DELETE https://domain.freshservice.com/cmdb/items/1/detach_relationship.json -d '{"relationship_id":"1"}' |
View Relationships
This API lets you view all the relationships of an asset.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET https://domain.freshservice.com/cmdb/items/1/relationships.json |
Solution Category
The Solution APIs allow you to perform all activities related to the creation and publishing of solutions to your requesters. You can create, modify or delete solutions from anywhere you want using the Solutions API.
The API is divided into 3 categories: 1. Solution Category, 2. Solution Folder 3. Solution Article
Attribute | Type | Description |
---|---|---|
id | number | Unique id of the solution category Read-Only |
name | string | Name of the solution category Mandatory |
description | string | Description about the solution category |
position | number | The rank of the solution category in the category listing Read-Only |
is_default | boolean | Set as true if the category is a default one Read-Only |
Create Solution Category
Use this API to create a new category of solutions.
1 2 3 4 5 6 | { "solution_category": { "name":"API", "description":"API related documents" } } |
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X POST -d '{ "solution_category": { "name":"API", "description":"API related documents" }}' https://domain.freshservice.com/solution/categories.json |
Update Solution Category
Use this API to update solution categories. For a list of all attributes that can be updated, look here
1 2 3 4 5 | { "solution_category": { "name":"Rest API" } } |
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X PUT -d '{ "solution_category": { "name":"Rest API" }}' https://domain.freshservice.com/solution/categories/4.json |
View Solution Category
To view the category available in your service desk, use this
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET https://domain.freshservice.com/solution/categories/4.json |
View All Solution Category
This API lets you view all the categories in a forum.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET https://domain.freshservice.com/solution/categories.json |
Delete Solution Category
To delete certain Categories, use this API.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X DELETE https://domain.freshservice.com/solution/categories/1.json |
Solution Folder
Know your way around the solution folders using these APIs
Attribute | Type | Description |
---|---|---|
id | number | Unique id of the solution folder Read-Only |
name | string | Name of the solution folder Mandatory |
description | string | Description of the solution folder |
position | number | Describes the position in which the folder is listed Read-Only |
is_default | boolean | Set as true is it is a default folder Read-Only |
category_id | number | ID of the category under which the folder is listed |
visibility | number | Accessibility of this folder |
department_folders_attributes[ ].department_id | number | ID of the department to which this solution folder is visible. ( Mandatory if visibility is set to '4') |
Solution Folder Properties
Visibility Type | Value |
---|---|
All | 1 |
Logged in Users | 2 |
Agents Only | 3 |
Departments | 4 |
Create Solution Folder
Use this API to create a new folder in your solutions.
1 2 3 4 5 6 7 8 9 10 11 12 | { "solution_folder": { "name":"Ticket API", "visibility":4, "description":"Ticket CRUD Operations", "department_folders_attributes": { "department_id": [ "4","5" ] } } } |
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X POST -d '{ "solution_folder": {"name":"Ticket API", "visibility":4, "description":"Ticket CRUD Operations", "department_folders_attributes": { "department_id": [ "4","5" ] } }}' https://domain.freshservice.com/solution/categories/4/folders.json |
Update Solution Folder
To update details of your solution folder, use this API. You can change the name, description and
1 2 3 4 5 6 | { "solution_folder": { "visibility":1, "description":"Tickets API related Operations" } } |
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X PUT -d '{ "solution_folder": { "visibility":1, "description":"Tickets API related Operations" }}' https://domain.freshservice.com/solution/categories/4/folders/6.json |
View Solution Folder
To view all folders present in a category, use this API.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET https://domain.freshservice.com/solution/categories/4.json |
Delete Solution Folder
This API can be used to delete solution folder. Deleted solution folders cannot be restored.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X DELETE https://domain.freshservice.com/solution/categories/1/folders/1.json |
Solution Article
With these APIs, create new solution articles, update existing ones, and more.
Attribute | Type | Description |
---|---|---|
id | number | Unique id of the solution article Read-Only |
title | string | Title of the solution article Mandatory |
description | string | Description of the solution article Mandatory |
position | number | The rank of the solution article in the article listing Read-Only |
art_type | number | The type of the article. ( 1 - permanent, 2 - workaround ) |
folder_id | number | ID of the folder under which the article is listed Mandatory |
status | number | Status of the article. ( 1 - draft, 2 - published ) |
thumbs_up | number | Number of upvotes for the article Read-Only |
thumbs_down | number | Number of down votes for the article Read-Only |
user_id | number | ID of the user who created the article Read-Only |
Create Solution Article
To write a new solution in a category, use this API.
Note:
It is also possible to send tags via URL:
/solution/categories/[id]/folders/[id]/articles.json?tags%5Bname%5D=csv
1 2 3 4 5 6 7 8 9 10 11 12 | { "solution_article": { "title": "Create a ticket", "status": 1, "art_type": 2, "description": "Steps: Fill in the mandatory fields ...", "folder_id": 1 }, "tags": { "name": "tag1, tag2" } } |
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X POST -d '{ "solution_article": { "title":"Create a ticket", "status":1, "art_type":2, "description":"Steps: Fill in the mandatory fields ...","folder_id":1 }, "tags":{"name": "tag1,tag2"}}' https://domain.freshservice.com/solution/categories/1/folders/1/articles.json |
Update Solution Article
To update an article, use this API.
Note:
It is also possible to send tags via URL:
/solution/categories/[id]/folders/[id]/articles/[id].json?tags%5Bname%5D=csv
1 2 3 4 5 6 | { "solution_article": { "title":"Steps to create a ticket", "description":"Steps: 1. Fill in the mandatory fields ..." } } |
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X PUT -d '{ "solution_article": { "title":"Steps to create a ticket", description":"Steps: 1. Fill in the mandatory fields ..." }}' https://domain.freshservice.com/solution/categories/3/folders/7/articles/3.json |
View Solution Article
If there is a specific article which you wish to view, use this API. Article ID is a must though.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET https://domain.freshservice.com/solution/categories/1/folders/1/articles/1.json |
View All Solution Article
To view all the articles, use this API.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET https://domain.freshservice.com/solution/categories/5/folders/8.json |
Delete Solution Article
To delete an article, use this API.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X DELETE https://domain.freshservice.com/solution/categories/1/folders/1/articles/1.json |
Service Catalog
This section lists all APIs that can be used to create or manipulate Service Requests.
Note:
The visibility and request of items can be restricted by using this parameter "requester_email=[requester_email]".
Attribute | Type | Description |
---|---|---|
id | number | Unique ID of the item |
name | string | Name of the item |
display_id | number | Item ID specific to your account |
category_id | number | Unique ID of the category |
configs | object | Have subject as a key with value that is used as service request subject. |
attachment_visibility | boolean | Set to True if requester is allowed to attach a file |
cost | number | Cost of the item |
cost_visibility | boolean | Set to True if cost should be visible to the requester |
create_child | boolean | Applicable to bundles. Set to True if additional items needs to be created as child tickets. |
deleted | boolean | Set to True if the item is deleted |
delivery_time | number | Estimated delivery time of the item |
delivery_time_visibility | boolean | Set to True if delivery time of the item should be visible to the requester |
group_visibility | number | Set ‘1’ for visibility to all requesters. Set ‘2’ for restricted visibility. |
visibility | number | Set ‘1’ for draft and ‘2’ for published. |
icon_name | string | Name of the icon |
package | boolean | Set to True for bundles |
product_id | number | The ID of the product mapped to the item |
quantity | number | Quantity needed by the requester |
quantity_visibility | boolean | Set as True to allow the requester to request for more than 1 quantity |
short_description | string | Short description of the item |
description | string | Description of the item |
created_at | datetime | The time at which the item was created |
updated_at | datetime | The time at with the item was updated |
Category fields
Attribute | Type | Description |
---|---|---|
id | number | Unique ID of the item |
name | string | Name of the item |
description | string | Description of the item |
position | number | Display order |
visibility | number | Set ‘1’ for draft and ‘2’ for published. |
group_visibility | number | Set ‘1’ for visibility to all requesters. Set ‘2’ for restricted visibility. |
created_date | datetime | The time at which the item was created |
updated_date | datetime | The time at with the item was updated |
Custom fields
Attribute | Type | Description |
---|---|---|
field_type | string | Type of field |
item_id | number | ID of the item |
label | string | Displayed label name |
name | string | Stored label name |
required | boolean | Set as True for mandatory field |
visible_in_portal | boolean | Set as True to make this field visible only for agents. |
Field Type in Custom Fields |
---|
custom_checkbox |
custom_date |
custom_decimal |
custom_number |
custom_text |
nested_field |
Create a service request
This API helps you create a service request with agent as requester
Note:
The service request will be created with the requester as “requester_email” if specified. If “requester_email” is not specified, then the service request will be created with Agent as Requester.
Note 2:
If a service item is not made visible to a requester and if that requester’s email is given in ‘requester_email’, then the Service Request will not get created.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | { "requested_item_values":{ "[item_display_id]":{ "item_id":"123", "quantity":"3" }, "[item_display_id]":{ "item_id":"124", "requested_item_value_attributes":{ "employee_name_124":"Sample", "role_124":"developer", "employee_email_id_124":"sample@yourcompany.com", "city_124":"new york" } } }, "requested_for":"sample@yourcompany.com", "requester_email":"sample@yourcompany.com" } |
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X POST https://domain.freshservice.com/catalog/request_items/1/service_request.json -d '{ "requested_item_values": { "1": {"item_id": "1", "requested_item_value_attributes": {} },"31":{"item_id": "31"} }, "requested_for": "sample@yourcompany.com","requester_email": "sample@yourcompany.com" }' |
View all service items
This API helps you to view all the service items in your service desk.
Note:
The requests are paginated to return only 20 items per page. Append the parameter "page=[:page_no]" in the url to traverse through pages.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET https://domain.freshservice.com/catalog/items.json?page=2 |
View all service categories
This API helps you to view all the service categories in your service desk.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET https://domain.freshservice.com/catalog/categories.json |
View all items in a Category
This API helps you to view all the service items in a particular category in your service desk.
Note:
The requests are paginated to return only 20 items per page. Append the parameter "page=[:page_no]" in the url to traverse through pages.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET https://domain.freshservice.com/catalog/categories/[category_id]/items.json?page=1 |
View item details for a particular item
This API helps you to view the details of a service item in your service desk.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET https://domain.freshservice.com/catalog/items/[display_id].json |
Contracts
This section lists all the APIs that can be used to perform operations related to Contracts such as creating, viewing and managing approvals.
Attribute | Type | Description |
---|---|---|
id | number | Unique ID of the contract Read-Only |
name | string | Subject/Title of the Contract Mandatory |
contract_id | number | Unique Contract Number Mandatory |
product_id | number | Product ID of software Mandatory for Software type |
vendor_id | number | Vendor ID of the Contract Mandatory |
contract_type | number | Number specifies Contract Type Mandatory |
notify_expiry | boolean | 0 or 1 which specifies whether notification on expiry required or not |
notify_before | number | Number which specifies days before when to notify |
expiry_notified | boolean | 0 or 1 which specifies expiry notified already or not |
to_emails | Array of Strings | List of email addresses to notify expiry |
license_type | number | Type of software licenseMandatory for Software Type |
display_id | number | Contract ID specific to your account Read-Only |
description | string | Plain text content of the contract |
description_html | string | HTML content of the contract |
attachments | array of objects | Attached files of the contract |
Notes
Contract Type
Description | Value |
---|---|
Lease | 1 |
Maintenance | 2 |
Software license | 3 |
Get the Custom Contract Type ID’s from ADMIN/Contract Types in portal.
License Type
Description | Values |
---|---|
Open Source | 1 |
Commercial | 2 |
Notify Before
Possible Values in Days |
---|
7 |
30 |
60 |
Contract Renewal
This API lets you renew an existing Contract in your service desk.
In the contract life cycle, data in fields such as Product, Vendor and Notification Recipient are constant and are shown as contract attributes. Variables such as start date, end date and cost are stored as separate entities. The entities of a contract which are currently in effect are shown as current data attributes.
Attribute | Type | Description |
---|---|---|
id | number | Unique ID for each renewal Read-Only |
contract_id | number | ID of contract to which renewal is associated to Mandatory |
requester_id | number | User ID of the requester for renewal Mandatory for Software type |
approver_id | number | Approval ID is user ID of approver who approves the contract Mandatory if approval required |
license_count | number | Number of licenses count Mandatory for software type |
status | number | Number which specifies contract statusRead-only |
renewal_type | number | Number which specifies Type of renewal Renewal or Extension |
cost | decimal | Cost of the Contract Mandatory |
comments | string | Comments made on rejection Mandatory on Rejection |
start_date | datetime | Start Date of the ContractMandatory |
end_date | datetime | End Date of the Contract Mandatory |
delegatee_id | number | Read only |
Notes
Status(Read-Only)
Description | Value |
---|---|
Draft | 1 |
Pending | 2 |
Approved | 3 |
Active | 4 |
Expired | 5 |
Rejected | 6 |
Cancelled | 7 |
Pending_ESign | 8 |
ESigned | 9 |
Decline_ESign | 10 |
Renewal Type
Description | Values |
---|---|
Renewal | 1 |
Extension | 2 |
License Count Max value is 2147483647
Cost value has max value is 99999999.99
Create a contract
This API lets you create a new Contract in your service desk.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | { "cmdb_contract":{ "name":"Contract Title", "contract_id":"CNTR-1234", "contract_type":1, "vendor_id":12345, "current_data_attributes":{ "approver_id":12345, "cost":22, "start_date":"2016-12-13", "end_date":"2016-12-30" } } } |
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -d '{ "cmdb_contract" : { "name" : "Contract Title" ,"contract_id": "CNTR-1234", "contract_type": 1, "vendor_id":12345 ,"current_data_attributes" : { "approver_id" : 12345, "cost" : 22, "start_date" : "2016-12-13", "end_date" : "2016-12-30"}}}' -X POST https://domain.freshservice.com/cmdb/contracts.json |
Create a contract with attachment
This API lets you create a new Contract with Attachments in your service desk.
1 | curl -u user@yourcompany.com:test -F "cmdb_contract[attachments][][resource]=@/path/to/ attachment.ext" -F "cmdb_contract[name]=Contract Title" -F "cmdb_contract[contract_id]=C13" -F "cmdb_contract[contract_type]=1" -F "cmdb_contract[vendor_id]=12345" -F "cmdb_contract[current_data_attributes][approver_id]=12345" -F "cmdb_contract[current_data_attributes][start_date]=2016-12-1" -F "cmdb_contract[current_data_attributes][end_date]=2017-12-2" -F "cmdb_contract[current_data_attributes][cost]=123" -X POST https://domain.freshservice.com/cmdb/contracts.json |
Create a contract with asset/ci attachment
This API lets you create a new Contract with associated Assets (CIs) in your service desk.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | { "cmdb_contract":{ "name":"Contract Title", "contract_id":"CNTR-1332222", "contract_items_attributes":{ "item_ids":"12345" }, "contract_type":1, "vendor_id":12345, "current_data_attributes":{ "approver_id":"12345", "cost":"22", "start_date":"2016-09-13", "end_date":"2016-12-30" } } } |
1 2 3 4 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -d '{ "cmdb_contract" : { "name" : "Contract Title" ,"contract_id": "CNTR-1332222", "contract_items_attributes" : { "item_ids" : "12345" }, "contract_type": 1, "vendor_id": 12345 ,"current_data_attributes" : { "approver_id" : "12345", "cost" : "22", "start_date" : "2016-09-13", "end_date" : "2016-12-30"}}}' -X POST https://domain.freshservice.com/cmdb/contracts.json |
View a contract
This API lets you retrieve and view a specific contract and its properties.
1 2 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET https:// domain.freshservice.com/cmdb/contracts/id.json |
View list of contracts
This API lets you retrieve a list of all contracts in your service desk.
Note:
All the listing requests and default and custom filters are paginated to return only 30 contracts per page. Append the parameter "page=[:page_no]" in the url to traverse through pages.
Filter by | Handle |
---|---|
Default filters: | /cmdb/contracts/filter/[filter_name]?format=json The various filters available are all, active, expired, lease, maintenance, software_license, expiry_range |
Requester | /helpdesk/tickets/filter/requester/[requester_id]?format=json |
View All Contracts | helpdesk/tickets.json |
1 2 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET https:// domain.freshservice.com/cmdb/contracts?format=json&page=1 |
Update a contract
This API lets you make changes to the parameters of a ticket from updating statuses to changing ticket type.
1 2 3 4 5 6 7 8 9 10 11 12 | { "cmdb_contract":{ "name":"Contract Title", "contract_id":"CNTR-2134", "current_data_attributes":{ "id":12345, "cost":24, "start_date":"2016-12-13", "end_date":"2016-12-30" } } } |
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -d '{ "cmdb_contract" : { "name" : "Contract Title" ,"contract_id": "CNTR-2134","current_data_attributes" : { "id" : 12345, "cost" : 24, "start_date" : "2016-12-13", "end_date" : "2016-12-30"}}}' -X PUT https://domain.freshservice.com/cmdb/contracts/id.json |
Submit for approval
This API lets you send a contract for approval in your service desk.
1 2 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X PUT https:// domain.freshservice.com/cmdb/contracts/id/submit_for_approval.json |
Approve a contract
This API lets you approve a contract that was sent for approval in your service desk.
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X PUT https:// domain.freshservice.com/cmdb/contracts/id/approve.json |
Reject a contract
This API lets you reject a contract that was sent for approval in your service desk.
1 2 3 4 5 | { "cmdb_contract":{ "comments":"Some details on rejection ..." } } |
1 | curl -u user@yourcompany.com:test -H "Content-Type: application/json" -X PUT -d '{"cmdb_contract" : {"comments" : "Some details on rejection ..."}}' https:// domain.freshservice.com/cmdb/contracts/id/reject.json |