Use the REST API to list, create, update and delete tickets on MerciYanis

About ticketing

Ticketing is one of the core features of MerciYanis, designed to help teams efficiently manage issues, incidents, and worker requests. With this feature, users can easily create, track, and resolve tickets, ensuring timely responses and smooth operations. Additionally, MerciYanis offers an automated ticket creation system, where sensors can trigger tickets when data thresholds are reached, allowing for proactive issue management and quick resolution of critical situations.

Data model

/**
 * A typical ticket structure in MerciYanis.
 */
Ticket {
  /**
   * Universal unique identifier (RFC 4122 compliant UUID) for this ticket.
   */ 
	_id: string;
	
	/**
	 * Registered user or service account that created this ticket.
	 */
	_createdBy: Id | User;
	
	/**
	 * Last registered user or service account that updated this ticket, if any.
	 */
	_updatedBy: Id | User | null;

	/**
	 * Whether this ticket has been deleted.
	 */
	_isDeleted: boolean;
	
	/**
	 * ISO 8601 formatted date and time of the ticket creation, in UTC.
	 */
	_createdAt: Date;
	
	/**
	 * ISO 8601 formatted date and time of the last ticket update, if any, in UTC.
	 */
	_updatedAt: Date | null;
	
	/**
	 * A human-readable, unique number for this ticket.
	 * Automatically generated on ticket creation.
	 */
	_number: number;

	/**
	 * Ticket title.
	 */
	title: string;
	
	/**
	 * Provides additional details about the ticket.
	 */
	description: string;
	
	/**
	 * Ticket status in the completion workflow.
	 */
	status: 'NEW' | 'IN_PROGRESS' | 'COMPLETED';
	
	/**
	 * Final location the ticket belongs to.
	 */
  location: Id | Location | null;
  	
	/**
	 * Ticket category.
	 */
  category: Id | Category | null;

  /**
   * A list of registered users that have been assigned to this ticket.
   * These users will be notified whenever the ticket is updated.
   */
   assignees: (Id | User)[];
   
  /**
   * A list of registered users that subscribed to this ticket.
   * These users will be notified whenever the ticket is updated.
   */
   followers: (Id | User)[];

  /**
   * A list of external followers (that did not register on the platform) for this ticket.
   * Each item is an email address. Whenever this ticket will be updated,
   * an email will be sent to all the specified followers.
   */
   externalFollowers: string[];

  /**
   * A list of external followers (that did not register on the platform) for this ticket.
   * Each item is an email address. Whenever this ticket will be updated,
   * an email will be sent to all the specified followers.
   */
   externalFollowers: string[];
}

POST /tickets

Creates a new ticket.

Headers

X-MerciYanis-Workspace string required

The name of the MerciYanis workspace to use.


User-Agent string required

Used to identify the user or application that is making the request.


Authorization string required

Bearer token to use to authenticate the request.

Body

See ticket data model reference.