PostInSeconds | BranchUp

About

This API is specifically for the partnership between BranchUp and PostInSeconds.

Calling the API

To call the API, use the APIKeyID and APIKeySecret headers that you created when creating an API key pair.

Endpoints

Each endpoint begins with https://api.postinseconds.com/v1/branchup/. For example, to get all of the BranchUp users, you would call https://api.postinseconds.com/v1/branchup/users.

Dev & Prod

To use the dev version of the API, create an API key pair and select "Dev" when prompted after clicking "Create API Key Pair".

Likewise, to use the prod version, follow the same steps but select "Prod" instead.

All of the endpoints, formats, etc. are exactly the same, but the databases are separate.

User

These endpoints are used to create, modify, and delete users.

Create or update a user

Modifies a user in our database. Creates the user if it does not already exist.

Authorizations:
(APIKeyIDAPISecretKey)
path Parameters
user_id
required
string

The ID of the user. Must be a maximum length of 60 characters and contain only alphanumeric characters, dashes, and underscores.

Request Body schema: application/json

User object to update. Only the fields that are being updated need to be included in the request body.

has_premium
boolean

Whether the user has an active premium subscription.

personal_name
string | null

The name of the user. Maximum of 60 characters.

business_name
string | null

The name of the business. Maximum of 60 characters.

contact_email
string | null

Email Format: username@domain.extension The email should consist of a username part, followed by an @ symbol, a domain name, and then a period (.) followed by an extension. The username, domain, and extension should not contain any @ symbols. Any deviation from this format results in a "contact_email must be a valid email." error. Maximum of 60 characters.

contact_phone
string | null

Phone Number Format: [+][Country Code]-[Main Number] If supplied, the phone number may optionally start with a +, followed by a 1 to 3-digit country code. A hyphen separator (-) is also optional. The main part of the number should be between 6 and 12 digits. Any deviation from this format results in a "contact_phone must be a valid phone number." error. Maximum of 60 characters.

call_to_action
string | null

The call to action of the user. Used in videos to tell the viewer what further action they should take (e.g., "I can plan your dream vacation. Link in bio."). Maximum of 60 characters.

focus_regions
Array of strings (Region)
Items Enum: "USA/Canada" "Mexico" "Caribbean" "Central/South America/Antarctica" "Europe" "Africa/Middle East" "Asia" "Australia/New Zealand/South Pacific"

The regions that the user focuses on.

focus_travel_types
Array of strings (TravelType)
Items Enum: "Adventure/Soft Adv/Expedition" "All-Inclusive" "Business Travel" "Cultural/Experiential Travel" "Cruise Ocean" "Cruise River" "Diving" "Escorted Vacations" "Family/Multi-Generational Vacations" "Golf" "Group Vacations" "Honeymoon/Wedding/Romantic" "Independent Travel" "Luxury" "Rail Travel" "Religious/Faith Travel" "Ski Vacations" "Vacation Rentals" "Wellness/Health/Spa"

The travel types that the user focuses on.

blocked_video_topics
Array of strings (VideoTopic)
Items Enum: "general" "weather" "landmark" "food_to_eat" "hiking_trail" "species" "lighthouse" "things_to_do" "places_to_see"

The video topics that the user has blocked. This list will expand over time, and new topics will be default allowed, unless they are specifically blocked.

Responses

Request samples

Content type
application/json
{
  • "has_premium": true,
  • "personal_name": "John Doe",
  • "business_name": "John Doe Travel",
  • "contact_email": "johndoe@travel.com",
  • "contact_phone": null,
  • "call_to_action": "I can plan your dream vacation. Link in bio.",
  • "focus_regions": [
    ],
  • "focus_travel_types": [
    ],
  • "blocked_video_topics": [
    ]
}

Response samples

Content type
application/json
{
  • "uid": "ambiSgN0u4htjNFEXrjLD2Jk3Iv1",
  • "has_premium": true,
  • "personal_name": "John Doe",
  • "business_name": "John Doe Travel",
  • "contact_email": "johndoe@travel.com",
  • "contact_phone": null,
  • "call_to_action": "I can plan your dream vacation. Link in bio.",
  • "focus_regions": [
    ],
  • "focus_travel_types": [
    ],
  • "blocked_video_topics": [
    ]
}

Delete a user

Deletes a user from our database.

Authorizations:
(APIKeyIDAPISecretKey)
path Parameters
user_id
required
string

The ID of the user

Responses

Get a user

Gets a user from our database.

Authorizations:
(APIKeyIDAPISecretKey)
path Parameters
user_id
required
string

The ID of the user

Responses

Response samples

Content type
application/json
{
  • "uid": "ambiSgN0u4htjNFEXrjLD2Jk3Iv1",
  • "has_premium": true,
  • "personal_name": "John Doe",
  • "business_name": "John Doe Travel",
  • "contact_email": "johndoe@travel.com",
  • "contact_phone": null,
  • "call_to_action": "I can plan your dream vacation. Link in bio.",
  • "focus_regions": [
    ],
  • "focus_travel_types": [
    ],
  • "blocked_video_topics": [
    ]
}

Gets all user videos

Lists all videos for a specific user in our database.

Authorizations:
(APIKeyIDAPISecretKey)
path Parameters
user_id
required
string

The ID of the user

query Parameters
page_index
integer

The index of the page of users that was returned. Starts at 0. Default is 0.

page_limit
integer

The maximum number of users that were returned per page. Default is 100.

Request Body schema: application/json

Filter videos by regions, travel types, and creation time.

regions
Array of strings (Region)
Items Enum: "USA/Canada" "Mexico" "Caribbean" "Central/South America/Antarctica" "Europe" "Africa/Middle East" "Asia" "Australia/New Zealand/South Pacific"

Filter by regions

travel_types
Array of strings (TravelType)
Items Enum: "Adventure/Soft Adv/Expedition" "All-Inclusive" "Business Travel" "Cultural/Experiential Travel" "Cruise Ocean" "Cruise River" "Diving" "Escorted Vacations" "Family/Multi-Generational Vacations" "Golf" "Group Vacations" "Honeymoon/Wedding/Romantic" "Independent Travel" "Luxury" "Rail Travel" "Religious/Faith Travel" "Ski Vacations" "Vacation Rentals" "Wellness/Health/Spa"

Filter by travel types

start_time_created
number | null

Filter by the earliest video creation time

end_time_created
number | null

Filter by the latest video creation time

Responses

Request samples

Content type
application/json
{
  • "regions": [
    ],
  • "travel_types": [
    ],
  • "start_time_created": 1691216800,
  • "end_time_created": 1693216800
}

Response samples

Content type
application/json
{
  • "page_index": 0,
  • "page_limit": 100,
  • "videos": [
    ]
}

Gets user logo image URL

Get the public URL to the logo image.

Authorizations:
(APIKeyIDAPISecretKey)
path Parameters
user_id
required
string

The ID of the user

Responses

Response samples

Upload logo image

Returns a pre-signed URL to AWS S3 that you can use to upload the logo to. You can see AWS documentation here. The maximum content size per file is 5MB. The image will be auto-cropped to a square in the center, so it is suggested to enforce cropping on the frontend to a square.

Authorizations:
(APIKeyIDAPISecretKey)
path Parameters
user_id
required
string

The ID of the user

Responses

Response samples

Content type
application/json
{
  • "fields": {
    }
}

Gets user profile image URL

Get the public URL to the profile image.

Authorizations:
(APIKeyIDAPISecretKey)
path Parameters
user_id
required
string

The ID of the user

Responses

Response samples

Upload profile image

Returns a pre-signed URL to AWS S3 that you can use to upload the profile image to. You can see AWS documentation here. The maximum content size per file is 5MB. The image will be auto-cropped to a square in the center, so it is suggested to enforce cropping on the frontend to a square.

Authorizations:
(APIKeyIDAPISecretKey)
path Parameters
user_id
required
string

The ID of the user

Responses

Response samples

Content type
application/json
{
  • "fields": {
    }
}

List all users

Lists all users in our database.

Authorizations:
(APIKeyIDAPISecretKey)
query Parameters
page_index
integer

The index of the page of users that was returned. Starts at 0. Default is 0.

page_limit
integer

The maximum number of users that were returned per page. Default is 100.

Responses

Response samples

Content type
application/json
{
  • "page_index": 0,
  • "page_limit": 100,
  • "users": [
    ]
}