Skip to main content

REST API

warning

We are still in beta

Please be advised that the public API provided herein is currently in the beta phase of development. As such, functionalities, endpoints, and parameters are subject to change without prior notice. While we strive to maintain compatibility and stability, users are encouraged to anticipate potential alterations and plan accordingly.

By accessing and utilizing the Public API, you acknowledge and accept the inherent risks associated with beta software, including but not limited to unexpected behavior, feature adjustments, and temporary service interruptions. We recommend regularly reviewing documentation and updates to stay informed about any modifications.

Your feedback and insights are invaluable in refining the API for its official release. Thank you for your understanding and cooperation during this beta testing phase.

About

You can use wethod API to build scripts and applications that automate processes requiring wethod data.

Getting started

About requests

Every request to the REST API includes an HTTP method and a path. Depending on the REST API endpoint, you might also need to specify request headers, authentication information, query parameters, or body parameters.

This documentation describes the HTTP method, path, and parameters for every endpoint.

HTTP method

The HTTP method of an endpoint defines the type of action it performs on a given resource. Some common HTTP methods are GET, POST, DELETE, and PATCH. The REST API reference documentation provides the HTTP method for every endpoint.

Where possible, we strive to use an appropriate HTTP method for each action:

  • GET: Used for retrieving resources
  • POST: Used for creating resources
  • PATCH: Used for updating properties of resources
  • PUT: Used for replacing resources or collections of resources
  • DELETE: Used for deleting resources

Path

Each endpoint has a path. This reference documentation gives the path for every endpoint.

The curly brackets {} in a path denote path parameters that you need to specify. Path parameters modify the endpoint path and are required in your request.

Headers

Headers provide extra information about the request and the desired response.

Authentication

All endpoints require authentication.

To authenticate your request, you will need to provide an authentication token with the required permissions, you can create a personal API token from your Account section. Tokens created in this section are assigned to your user and have the same permissions as you have.

After creating a token, you can authenticate your request by sending the token in the Authorization header of your request. For example, in the following request, replace YOUR-TOKEN with a reference to your token:

curl --request GET \
--url "https://api.wethod.com/api/people-allocations" \
--header "Authorization: Bearer <YOUR-TOKEN>"

Selecting your company

All endpoints require you to specify the company you want to interact with. You can do this by including the Wethod-Company header in your request. For example:

 curl --request GET \
--url "https://api.wethod.com/api/people-allocations" \
--header "Wethod-Company: <COMPANY-ENDPOINT>"

The endpoint of your company can be found in the URL you use to access wethod. For example, if you access wethod at https://acme.wethod.com, then acme is the endpoint of your company.

API version

All endpoints require you to specify the version of the API you want to interact with. You can do this by including the Wethod-Version header in your request. For example:

   curl --request GET \
--url "https://api.wethod.com/api/people-allocations" \
--header "Wethod-Version: <API-VERSION>"

Available API versions:

  • 2024-06-15

Parameters

Many API methods require or allow you to send additional information in parameters in your request. There are a few different types of parameters: Path parameters, body parameters, and query parameters.

Path parameters Path parameters modify the endpoint path. These parameters are required in your request.

Body parameters Body parameters allow you to pass additional data to the API. These parameters can be optional or required, depending on the endpoint. The documentation for each API endpoint will describe the body parameters that it supports.

Query parameters Query parameters allow you to control what data is returned for a request. These parameters are usually optional. The documentation for each API endpoint will describe any query parameters that it supports.

Rate limits

We limit the number of API requests that you can make within a specific amount of time. This limit helps prevent abuse and denial-of-service attacks, and ensures that the API remains available for all users.

All requests count towards two limits:

  • Your personal rate limit of 3,000 requests per hour
  • Your company rate limit of 5,000 request per hour

If you exceed one of the above limits, you will receive a 429 response. You should not retry your request until after the time specified by the x-ratelimit-retry-after header.

You can find the reason for the limiting expressed in the x-ratelimit-scope:

  • user if you exceeded your personal rate limit
  • company if you exceeded your company's rate limit

If your request continues to fail due to a rate limit, wait for an exponentially increasing amount of time between retries, and throw an error after a specific number of retries.

Continuing to make requests while you are rate limited may result in the banning of your integration.

Pagination

When a response from the REST API would include many results, we will paginate the results and return a subset of the results. This makes the response easier to handle for servers and for people.

You can use the offset and limit query parameters to require additional results or to change the amount of results returned.

Full example

   curl --request GET \
--url "https://api.wethod.com/api/people-allocations" \
--header "Authorization: Bearer <YOUR-TOKEN>" \
--header "Wethod-Company: acme" \
--header "Wethod-Version: 2024-06-15"