Skip to main content
Marty uses standard HTTP status codes to indicate whether an API request was successful or why it failed. Successful requests return the requested data or confirmation that the operation was completed. If a request cannot be completed, the API returns an appropriate HTTP status code indicating the nature of the failure, together with a JSON response body containing additional information about the error.

HTTP status codes

  • 200 OK — The request was successful.
  • 201 Created — The requested resource was successfully created.
  • 204 No Content — The request was successfully processed, but there is no content to return in the response body.
  • 301 Moved Permanently — The requested resource has been permanently moved.
  • 400 Bad Request — The request contains a missing, invalid, or malformed parameter. Check the API documentation and request syntax, then try again.
  • 401 Unauthorized — A valid API access token was not provided. Authentication is required for all API requests. See the authentication documentation for more information.
  • 403 Forbidden — The authenticated API access token does not have permission to perform the requested operation.
  • 404 Not Found — The requested endpoint, method, or resource does not exist. Verify that the request path, HTTP method, and resource identifier are correct.
  • 409 Conflict — The request could not be completed because it conflicts with the current state of the requested resource. This may occur when attempting to create or update a resource that already exists, or when the requested operation conflicts with existing data.
  • 429 Too Many Requests — The API rate limit has been exceeded. Reduce the request frequency and retry after the appropriate interval.
  • 500 Internal Server Error — An unexpected error occurred on the Marty API. Retry the request and contact support if the issue persists.
  • 503 Service Unavailable — The Marty API is temporarily unavailable, typically due to maintenance or an outage. Retry the request using exponential backoff.

Example error response

When an API request fails, the response body may contain additional information that can help identify the cause of the error.
The exact fields included in an error response may vary depending on the type of error. When troubleshooting an API request, the HTTP status code and detail field are usually the best places to start. If you need additional help, contact Marty support at https://support.marty.hr/ and include the error details, especially the traceId and requestId, to help the support team investigate the issue.

Paginated responses

Endpoints that return collections of resources may use pagination to divide large result sets into smaller pages. A paginated response contains the resources for the current page in the data array, together with pagination metadata describing the current page and the total number of available records.

Example paginated response

Pagination fields

  • data — The resources returned for the current page.
  • selected — Selected resources, when applicable to the endpoint.
  • totalCount — The total number of resources matching the request.
  • totalPages — The total number of pages available.
  • page — The current page number.
  • pageSize — The maximum number of resources returned per page.
For example, if totalCount is 20 and pageSize is 20, the result contains one page. If totalCount is 45 and pageSize is 20, the result is divided across three pages. When an endpoint supports pagination parameters, use them to request additional pages until all required resources have been retrieved.