The Prospero API allows you to programmatically interact with a Prospero Organization. The API is RESTful and uses JSON to transport most data. It's the same API we use internally to build our applications.
You can use the Prospero API to build your own scripts, applications, and integrations with external systems.
Endpoint
Prospero's API endpoint is:
Code
You can always GET the base endpoint to check the health of the API. It should return a 200 status code with the content "Hello, Prospero!".
Authentication
Prospero supports personal access & refresh tokens. We intend to support full OAuth2 authentication for third-party applications in the future.
Refer to Authentication for a detailed guide on how to obtain and use these tokens.
Error Handling
The Prospero API uses standard HTTP status codes to indicate the success or failure of a request. For example, a 200 "OK" indicates the request was successful. For more information on HTTP status codes, we recommend referring to the Mozilla HTTP status code documentation.
Unsuccessful requests will return a JSON object in the response payload with the following signature:
Code
For example, if you send an invalid payload to create a resource, you might receive an error response like this:
Code
Use strongly-typed clients when possible to catch validation errors at development time, and always validate required fields to avoid runtime errors.
Identifiers
Each entity in Prospero has a globally unique identifier. These are v1 UUIDs. You can use a library like uuid to validate them.
Dates & Times
Prospero uses ISO 8601-compliant dates and times. In most cases, these are formatted in standard YYYY-MM-DDThh:mm:ssZ format, though some fields may contain isolated dates (YYYY-MM-DD) or times (hh:mm:ss). In all cases, the Prospero API expects and returns dates and times in UTC.
Always pass dates and times in UTC. Timezones other than UTC are unsupported and will fail validation. Timezone information is stored separately from dates and times, and is resolved at runtime in our applications.
Get Started
You can get a high-level overview of the relationships between Prospero entities here.
Once you have obtained your access token, you can start interacting with the API.
Who Am I?
To introspect the current authenticated user, you can use the /auth/whoami endpoint:
Code
Working with Events
To list Events in your Organization, use the /events endpoint with query parameters to limit your retrieval:
Code
By inspecting the result, you can find Events you want to work with. Store their ids for later use.
You can also locate the ids of Events, Bookings, and other entities directly within Prospero via the page URL. For example, the URL of an Event page looks like this: https://app.prosperoapp.com/calendar/event/:id/overview.
To create a new Event, send a POST request to the /events endpoint:
Code
This request will create a new Event and return its full state, including the newly assigned id, if the call was successful (201 status code).
Once you've created an Event or found an Event you want to update, you can send a PATCH request to the /events/:id endpoint. Prospero uses JSON merge patch semantics - that is, Prospero will only update the fields passed in the payload, and leave all unspecified fields unchanged.
Code
Fetching Updates
If you're working on building an application which displays Prospero data and you want the information to update in (near) realtime, you have a few options. To prevent excessive usage of our API, we recommend that you be mindful about your implementation.
Lets say you're displaying a large number of Events in your application and want to update them:
Do:
- Register a programmatic webhook and get updates for all
Eventsin theOrganization. When you detect changes, update theEventinformation. - If you have to fetch recent changes, order results by returning recently updated
Eventsfirst. - Filter
Eventsin your request instead of fetching allEventsand filtering in code.
Don't:
- Poll updates for each
Eventin the application. There should never be a reason to do this and your application might get rate limited. See the above tactics for better implementations.
If you have any questions, please reach out to us.