Introduction

Are you missing a feature? Please use our Feature Board to add a suggestion or upvote existing features. Sign up to the waitlist to get notified of future updates and releases.

Good to know

  • BaseURL of the API is https://instantrestapi.com/api/
  • The resource name can be anything that is accepted in a URL path (such as invoices or customers, except in the website test playground - it is fixed to resources).
  • api/temporary-key and api/waitlist endpoints are restricted and can only be used as described in the authentication section.
  • All resources created are scoped to an API key and can only be accessed using that specific key.

Creating a resource

Create a resource simply by POSTing a JSON object to the API URL followed by the name of your resource. For example: to create a new invoice, send a POST request to the api/invoices endpoint with a request body of the invoice object. The following requirements must be met:

  • Header Content-Type must be application/json
  • Body must not be empty
  • Body must be a valid JSON
  • Body must contain id field
  • Body must be less than 1mb
POST & PUT are functionally the same, both will “upsert” the object for the specifid id.

Filtering & Searching

The API does not currently support filtering or searching of resources.

Schema

As long as the request body contains a valid JSON object, it will be accepted.

All objects must include a property with name id that is the unique identifier.

The API does not currently support indexes or constraints.

Relationships

The API does not currently support any type of relationship between resources. Instead, you may choose one of the following 2 options.

1. Embedding related resources

The easiest strategy is to embed the related resources inside the top level resource. For example, you can embed a customer object or invoice lines in the invoice object as shown below:

{
    "id": "1",
    "invoiceNumber": "12345",
    "amount": 100.00,
    "customer": {
        "id": "1",
        "firstName": "John",
        "lastName": "Doe",
    },
    "invoiceLines": [
        {
            "id": "1",
            "description": "Product 1",
            "quantity": 1,
            "unitPrice": 100.00
        }
    ]
}

Any time a customer or invoiceLine is updated, you must also update the whole invoice object to reflect the changes.

2. Embedding ids

Alternatively, you can embed references to other resources by id if you keep track of relationsship updates client side.

For example, consider the below:

{
    "id": "1",
    "invoiceNumber": "12345",
    "amount": 100.00,
    "customerId": "1",
    "invoiceLineIds": ["1"]
}

So if you request a DELETE on api/invoicelines/1, you must also do a PUT on api/invoices/1 and remove the invoiceline from invoiceLineIds array.

Subresources

The API does not currently support subresources. So for example, you cannot create/get an invoice line by sending a POST/GET request to api/invoices/1/invoicelines/1.