Work with this as data
Every API here is available over the APIs.io API and to AI agents over MCP.
MCP server
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
Tools for apis
7 MCP tools reach this
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.
Call it yourself
curl for this page
This API
curl "https://apis.io/api/v1/apis/salesmsg:salesmsg-organizations-agency-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
OpenAPI Specification
openapi: 3.2.0
info:
title: SalesMessage Public Organizations Agency API
description: '## Introduction
This API documentation will start with an overview of the Salesmsg authorization methods and flows, followed by reference information about each specific endpoint. ## Mock Server
Additionally, if you want to try the API requests out on our mock server, then you can import the endpoints and set baseUrl variable in your collection as `https://e33e4a6a-ff9d-419f-a378-ec53560c0bb7.mock.pstmn.io`
## Authentication
Supported authorization methods include: **Personal Access Token (PAT)** and **OAuth2**. Whether to use PAT or regular OAuth2 tokens highly depends on your use case. - **OAuth2** authorization type is to go for in case you want to allow other users to authenticate against SalesMessage in order for your app to use the issued token as well as utilize the SalesMessage’s functionality. - **PAT** authorization type is to go for in case you want to integrate your personal existing account with Salesmsg in order to extend your app’s functionality. PAT are managed by the user, which means that they are tied to a user account. This makes Personal Access Tokens a good choice for development, as well as automation purposes, when an application does only require a single SalesMessage account to manage organizations. ### OAuth2
The first step in implementing OAuth2 is registering an oauth application and retrieving your client ID and client secret. Most people who will be implementing OAuth2 will want to find and utilize a library in the language of their choice. For those implementing OAuth2 from scratch, please see RFC 6749 for details. After you create your application with SalesMessage, make sure that you have your `client_id` and `client_secret` handy. The next step is to figure out which OAuth2 flow is right for your purposes. Here are your options:
- Authorization code grant flow
- Implicit grant flow
##### OAuth2 URLs
| URL | Description |
|-----------------------|------|
| `https://app.salesmessage.com/auth/oauth` | Base authorization URL |
| `https://api.salesmessage.com/pub/v2.3/oauth/token` | Token URL |
#### 1. Authorization code grant flow
The authorization code grant flow is most suitable for **web and mobile applications**. It differs from the other grant types by requiring the application to launch a browser first to begin the integration. The integration consists of the following steps:
1. The application opens a browser to send the user to the OAuth server. 2. The user receives the authorization prompt and approves the application request. 3. The user is redirected back to the app with the authorization code in the query string. 4. The application exchanges the authorization code for an access token. Below, you can find the description of the authorization code grant flow in detail. ##### Get user permission
The application sends the user to a browser to get their permission. To begin the authorization flow, construct and open a URL like:
```
https://app.salesmessage.com/auth/oauth
?response_type=code
&client_id={client_id}
&redirect_uri={redirect_uri}
&scope={scope}
&state={state}
```
##### Examples:
```
# Read/write users
https://app.salesmessage.com/auth/oauth?response_type=code&client_id=269&redirect_uri=https://example.app/callback&scope=users:read%20users:write&state=xcoiv98y2kd22vusuye3kch
# Read contacts
https://app.salesmessage.com/auth/oauth?response_type=code&client_id=269&redirect_uri=https://example.app/callback&scope=contacts:read&state=xcoiv98y2kd22vusuye3kch
```
Here’s each query parameter explained:
| Parameter | Description |
|-----------------------|------|
| `Response_type` | Set to code indicating that you want an authorization code as the response. |
| `Client_id` | The identifier for apps. You will find it on the OAuth Applications page. |
| `Redirect_uri` | Used to redirect to after the user is granted permission or denied permission. The URI needs to have been entered in the Redirect URI field that the user specified at creating the application.'
version: v2.3
servers:
- url: https://api.salesmessage.com/pub/v2.3
tags:
- name: Organizations Agency
description: Organizations Agency
paths:
/agency/invites:
get:
tags:
- Organizations Agency
summary: Get agency`s invitations
description: 'REQUIRED SCOPES [''organizations-agency:read'']
Get agency`s invitations'
operationId: 559136b0f279284417659e2c7892c3d7
responses:
'200':
description: OK
security:
- apiAuth:
- organizations-agency:read
x-versions:
- public
post:
tags:
- Organizations Agency
summary: Create agency's invitation
description: 'REQUIRED SCOPES [''organizations-agency:write'']
Create agency''s invitation'
operationId: 37ecd76ecfab8860a81a4de9b33674ec
requestBody:
content:
application/json:
schema:
required:
- email
- plan
properties:
email:
description: Email
type: string
format: email
example: test@test.test
plan:
description: Plan
type: string
example: ''
trial:
description: Trial
type: boolean
example: true
organization_clone:
description: Organization clone
type:
- integer
- 'null'
example: null
affiliate_link:
description: Agency Affiliate Link
type:
- string
- 'null'
example: https://www.salesmessage.com/?fp_ref=example
payment_method:
description: ID of payment method. It's taken into account when Organization is Franchise
type:
- string
- 'null'
example: null
pay_now:
description: Pay now flag
type:
- boolean
- 'null'
example: null
card_token:
description: Optional field for card token. It's taken into account when 'pay_now' is TRUE
type:
- string
- 'null'
example: null
first_name:
description: First name of customer. It's taken into account when 'pay_now' is TRUE
type:
- string
- 'null'
example: null
last_name:
description: Last name of customer. It's taken into account when 'pay_now' is TRUE
type:
- string
- 'null'
example: null
integration_teams:
description: The IDs of the Teams. It's taken into account when groups flow is allowed.
type:
- array
- 'null'
items:
type: integer
example: null
type: object
responses:
'200':
description: OK
'400':
description: Create Customer Error
content:
application/json:
schema:
properties:
message:
title: message
type: string
type: object
security:
- apiAuth:
- organizations-agency:write
x-versions:
- public
/agency/invites/{clientInvitation}/resend:
post:
tags:
- Organizations Agency
summary: Resend the invitation
description: 'REQUIRED SCOPES [''organizations-agency:write'']
Resend the invitation'
operationId: 46e61c30867d79bc689a6940ec573c69
parameters:
- name: clientInvitation
in: path
description: The ID of the Client invitation
required: true
schema:
type: string
example: ''
responses:
'200':
description: OK
security:
- apiAuth:
- organizations-agency:write
x-versions:
- public
/agency/invites/{clientInvitation}:
post:
tags:
- Organizations Agency
summary: Update the invitation
description: 'REQUIRED SCOPES [''organizations-agency:write'']
Update the invitation'
operationId: 3bfede6f28507bf1997f70592e796e7d
parameters:
- name: clientInvitation
in: path
description: The ID of the Client invitation
required: true
schema:
type: string
example: ''
requestBody:
content:
application/json:
schema:
required:
- email
properties:
email:
description: New email for updating
type: string
format: email
example: test@test.test
type: object
responses:
'200':
description: OK
security:
- apiAuth:
- organizations-agency:write
x-versions:
- public
delete:
tags:
- Organizations Agency
summary: Delete the invitation
description: 'REQUIRED SCOPES [''organizations-agency:write'']
Delete the invitation'
operationId: 7b4da7fcd7f949af70179c44d2c43072
parameters:
- name: clientInvitation
in: path
description: The ID of the Client invitation
required: true
schema:
type: string
example: ''
responses:
'200':
description: OK
security:
- apiAuth:
- organizations-agency:write
x-versions:
- public
/agency/invites/validate:
post:
tags:
- Organizations Agency
summary: Validate email on invitation create
description: 'REQUIRED SCOPES [''organizations-agency:write'']
Validate email on invitation create'
operationId: 5445fcdb00612e17c6c757ba012ed820
requestBody:
content:
application/json:
schema:
required:
- email
properties:
email:
description: Email
type: string
format: email
example: test@test.test
type: object
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
valid:
title: Valid
type: boolean
type: object
security:
- apiAuth:
- organizations-agency:write
x-versions:
- public
/agency/clients/{client}:
delete:
tags:
- Organizations Agency
summary: Deletes the client from an agency
description: 'REQUIRED SCOPES [''organizations-agency:write'']
Deletes the client from an agency'
operationId: 90e80209084cc7d885d7d9eb95e85184
parameters:
- name: client
in: path
description: The ID of the Client
required: true
schema:
type: string
example: ''
responses:
'200':
description: OK
security:
- apiAuth:
- organizations-agency:write
x-versions:
- public
/agency/clients:
get:
tags:
- Organizations Agency
summary: Get clients
description: 'REQUIRED SCOPES [''organizations-agency:read'']
Fetches a list of clients based on specified criteria.'
operationId: 924baa04120ee8284c6978d9b9b8242b
parameters:
- name: sortBy
in: query
description: Field to sort by
required: false
schema:
type: string
example: name
- name: sortOrder
in: query
description: Sort order
required: false
schema:
type: string
example: asc
- name: all
in: query
description: Fetch all clients without pagination
required: false
schema:
type: boolean
example: false
- name: search
in: query
description: Search term
required: false
schema:
type: string
- name: length
in: query
description: Number of results per page
required: false
schema:
type: integer
example: 20
- name: page
in: query
description: Page number
required: false
schema:
type: integer
example: 1
- name: fields_list
in: query
description: List of specific fields to return
required: false
schema:
type: array
items:
type: string
responses:
'200':
description: Successful retrieval of client list
content:
application/json:
schema:
oneOf:
- type: array
items:
$ref: '#/components/schemas/OrganizationLiteResource'
- properties:
data:
type: array
items:
$ref: '#/components/schemas/OrganizationResource'
meta:
type: object
links:
type: object
type: object
'404':
description: Not Found
security:
- apiAuth:
- organizations-agency:read
x-versions:
- public
components:
schemas:
OrganizationResource:
description: Class OrganizationResource
properties:
id:
title: ID
type: integer
owner_id:
title: Owner ID
type: integer
number_vendor_id:
title: Number Vendor ID
type: integer
name:
title: Name
type: string
photo_url:
title: Photo url
type: string
type: object
xml:
name: OrganizationResource
OrganizationLiteResource:
title: OrganizationLiteResource
description: A simplified representation of an Organization
properties:
id:
description: Unique identifier of the organization
type: integer
example: 1
name:
description: Name of the organization
type: string
example: SalesMessage Inc.
country:
description: Country where the organization is registered
type: string
example: US
is_agency:
description: Indicates if the organization is an agency
type: boolean
example: true
agency_id:
description: ID of the agency this organization belongs to
type:
- integer
- 'null'
example: 321
vendor_id:
description: Vendor ID associated with the organization
type:
- string
- 'null'
example: vnd-567
stripe_id:
description: Stripe customer ID
type:
- string
- 'null'
example: stripe-5678
created_at:
description: Timestamp when the organization was created
type: string
format: date-time
example: '2024-03-18T14:23:00Z'
updated_at:
description: Timestamp when the organization was last updated
type: string
format: date-time
example: '2024-03-19T10:15:00Z'
type: object
securitySchemes:
apiAuth:
type: http
description: Login with email and password to get the authentication token
bearerFormat: JWT
scheme: bearer