Endpoint related APIs
- getEndpoints - List all endpoints
- createEndpoint - Create an endpoint
- testOAuth2Connection - Test OAuth2 connection
- getEndpointPeriodFailureRates - Endpoint period failure rates
- deleteEndpoint - Delete endpoint
- getEndpoint - Retrieve endpoint
- updateEndpoint - Update an endpoint
- activateEndpoint - Activate endpoint
- expireSecret - Roll endpoint secret
- pauseEndpoint - Pause endpoint
This endpoint fetches an endpoints
import { Convoy } from "convoy.js";
const convoy = new Convoy({
apiKeyAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await convoy.endpoints.getEndpoints({
projectID: "<id>",
nextPageCursor: "01H0JA5MEES38RRK3HTEJC647K",
ownerId: "01H0JA5MEES38RRK3HTEJC647K",
perPage: 20,
prevPageCursor: "01H0JATTVCXZK8FRDX1M1JN3QY",
q: "endpoint-1",
sort: "ASC | DESC",
});
console.log(result);
}
run();The standalone function version of this method:
import { ConvoyCore } from "convoy.js/core.js";
import { endpointsGetEndpoints } from "convoy.js/funcs/endpoints-get-endpoints.js";
// Use `ConvoyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const convoy = new ConvoyCore({
apiKeyAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await endpointsGetEndpoints(convoy, {
projectID: "<id>",
nextPageCursor: "01H0JA5MEES38RRK3HTEJC647K",
ownerId: "01H0JA5MEES38RRK3HTEJC647K",
perPage: 20,
prevPageCursor: "01H0JATTVCXZK8FRDX1M1JN3QY",
q: "endpoint-1",
sort: "ASC | DESC",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("endpointsGetEndpoints failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.GetEndpointsRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.GetEndpointsResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.GetEndpointsBadRequestError | 400 | application/json |
| errors.GetEndpointsUnauthorizedError | 401 | application/json |
| errors.GetEndpointsNotFoundError | 404 | application/json |
| errors.ConvoyDefaultError | 4XX, 5XX | */* |
This endpoint creates an endpoint
import { Convoy } from "convoy.js";
const convoy = new Convoy({
apiKeyAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await convoy.endpoints.createEndpoint("<id>", {});
console.log(result);
}
run();The standalone function version of this method:
import { ConvoyCore } from "convoy.js/core.js";
import { endpointsCreateEndpoint } from "convoy.js/funcs/endpoints-create-endpoint.js";
// Use `ConvoyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const convoy = new ConvoyCore({
apiKeyAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await endpointsCreateEndpoint(convoy, "<id>", {});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("endpointsCreateEndpoint failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
projectID |
string | ✔️ | Project ID |
body |
models.ModelsCreateEndpoint | ✔️ | Endpoint Details |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.CreateEndpointResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.CreateEndpointBadRequestError | 400 | application/json |
| errors.CreateEndpointUnauthorizedError | 401 | application/json |
| errors.CreateEndpointNotFoundError | 404 | application/json |
| errors.ConvoyDefaultError | 4XX, 5XX | */* |
This endpoint tests the OAuth2 connection by attempting to exchange a token
import { Convoy } from "convoy.js";
const convoy = new Convoy({
apiKeyAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await convoy.endpoints.testOAuth2Connection("<id>", {});
console.log(result);
}
run();The standalone function version of this method:
import { ConvoyCore } from "convoy.js/core.js";
import { endpointsTestOAuth2Connection } from "convoy.js/funcs/endpoints-test-o-auth2-connection.js";
// Use `ConvoyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const convoy = new ConvoyCore({
apiKeyAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await endpointsTestOAuth2Connection(convoy, "<id>", {});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("endpointsTestOAuth2Connection failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
projectID |
string | ✔️ | Project ID |
body |
models.ModelsTestOAuth2Request | ✔️ | OAuth2 Configuration |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.TestOAuth2ConnectionResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.TestOAuth2ConnectionBadRequestError | 400 | application/json |
| errors.TestOAuth2ConnectionUnauthorizedError | 401 | application/json |
| errors.TestOAuth2ConnectionNotFoundError | 404 | application/json |
| errors.ConvoyDefaultError | 4XX, 5XX | */* |
Display-only delivery rates for the given endpoint ids over a date range (default last 7 days). Independent of the list so a slow COUNT cannot delay the table.
import { Convoy } from "convoy.js";
const convoy = new Convoy({
apiKeyAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await convoy.endpoints.getEndpointPeriodFailureRates("<id>");
console.log(result);
}
run();The standalone function version of this method:
import { ConvoyCore } from "convoy.js/core.js";
import { endpointsGetEndpointPeriodFailureRates } from "convoy.js/funcs/endpoints-get-endpoint-period-failure-rates.js";
// Use `ConvoyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const convoy = new ConvoyCore({
apiKeyAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await endpointsGetEndpointPeriodFailureRates(convoy, "<id>");
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("endpointsGetEndpointPeriodFailureRates failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
projectID |
string | ✔️ | Project ID |
endpointId |
string[] | ➖ | Endpoint IDs |
startDate |
string | ➖ | Start date |
endDate |
string | ➖ | End date |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.GetEndpointPeriodFailureRatesResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.GetEndpointPeriodFailureRatesBadRequestError | 400 | application/json |
| errors.GetEndpointPeriodFailureRatesUnauthorizedError | 401 | application/json |
| errors.GetEndpointPeriodFailureRatesNotFoundError | 404 | application/json |
| errors.ConvoyDefaultError | 4XX, 5XX | */* |
This endpoint deletes an endpoint
import { Convoy } from "convoy.js";
const convoy = new Convoy({
apiKeyAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await convoy.endpoints.deleteEndpoint("<id>", "<id>");
console.log(result);
}
run();The standalone function version of this method:
import { ConvoyCore } from "convoy.js/core.js";
import { endpointsDeleteEndpoint } from "convoy.js/funcs/endpoints-delete-endpoint.js";
// Use `ConvoyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const convoy = new ConvoyCore({
apiKeyAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await endpointsDeleteEndpoint(convoy, "<id>", "<id>");
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("endpointsDeleteEndpoint failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
projectID |
string | ✔️ | Project ID |
endpointID |
string | ✔️ | Endpoint ID |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.DeleteEndpointResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.DeleteEndpointBadRequestError | 400 | application/json |
| errors.DeleteEndpointUnauthorizedError | 401 | application/json |
| errors.DeleteEndpointNotFoundError | 404 | application/json |
| errors.ConvoyDefaultError | 4XX, 5XX | */* |
This endpoint fetches an endpoint
import { Convoy } from "convoy.js";
const convoy = new Convoy({
apiKeyAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await convoy.endpoints.getEndpoint("<id>", "<id>");
console.log(result);
}
run();The standalone function version of this method:
import { ConvoyCore } from "convoy.js/core.js";
import { endpointsGetEndpoint } from "convoy.js/funcs/endpoints-get-endpoint.js";
// Use `ConvoyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const convoy = new ConvoyCore({
apiKeyAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await endpointsGetEndpoint(convoy, "<id>", "<id>");
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("endpointsGetEndpoint failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
projectID |
string | ✔️ | Project ID |
endpointID |
string | ✔️ | Endpoint ID |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.GetEndpointResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.GetEndpointBadRequestError | 400 | application/json |
| errors.GetEndpointUnauthorizedError | 401 | application/json |
| errors.GetEndpointNotFoundError | 404 | application/json |
| errors.ConvoyDefaultError | 4XX, 5XX | */* |
This endpoint updates an endpoint
import { Convoy } from "convoy.js";
const convoy = new Convoy({
apiKeyAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await convoy.endpoints.updateEndpoint("<id>", "<id>", {});
console.log(result);
}
run();The standalone function version of this method:
import { ConvoyCore } from "convoy.js/core.js";
import { endpointsUpdateEndpoint } from "convoy.js/funcs/endpoints-update-endpoint.js";
// Use `ConvoyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const convoy = new ConvoyCore({
apiKeyAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await endpointsUpdateEndpoint(convoy, "<id>", "<id>", {});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("endpointsUpdateEndpoint failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
projectID |
string | ✔️ | Project ID |
endpointID |
string | ✔️ | Endpoint ID |
body |
models.ModelsUpdateEndpoint | ✔️ | Endpoint Details |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.UpdateEndpointResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.UpdateEndpointBadRequestError | 400 | application/json |
| errors.UpdateEndpointUnauthorizedError | 401 | application/json |
| errors.UpdateEndpointNotFoundError | 404 | application/json |
| errors.ConvoyDefaultError | 4XX, 5XX | */* |
Activated an inactive endpoint
import { Convoy } from "convoy.js";
const convoy = new Convoy({
apiKeyAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await convoy.endpoints.activateEndpoint("<id>", "<id>");
console.log(result);
}
run();The standalone function version of this method:
import { ConvoyCore } from "convoy.js/core.js";
import { endpointsActivateEndpoint } from "convoy.js/funcs/endpoints-activate-endpoint.js";
// Use `ConvoyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const convoy = new ConvoyCore({
apiKeyAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await endpointsActivateEndpoint(convoy, "<id>", "<id>");
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("endpointsActivateEndpoint failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
projectID |
string | ✔️ | Project ID |
endpointID |
string | ✔️ | Endpoint ID |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.ActivateEndpointResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ActivateEndpointBadRequestError | 400 | application/json |
| errors.ActivateEndpointUnauthorizedError | 401 | application/json |
| errors.ActivateEndpointNotFoundError | 404 | application/json |
| errors.ConvoyDefaultError | 4XX, 5XX | */* |
This endpoint expires and re-generates the endpoint secret.
import { Convoy } from "convoy.js";
const convoy = new Convoy({
apiKeyAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await convoy.endpoints.expireSecret("<id>", "<id>", {});
console.log(result);
}
run();The standalone function version of this method:
import { ConvoyCore } from "convoy.js/core.js";
import { endpointsExpireSecret } from "convoy.js/funcs/endpoints-expire-secret.js";
// Use `ConvoyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const convoy = new ConvoyCore({
apiKeyAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await endpointsExpireSecret(convoy, "<id>", "<id>", {});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("endpointsExpireSecret failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
projectID |
string | ✔️ | Project ID |
endpointID |
string | ✔️ | Endpoint ID |
body |
models.ModelsExpireSecret | ✔️ | Expire Secret Body Parameters |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.ExpireSecretResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ExpireSecretBadRequestError | 400 | application/json |
| errors.ExpireSecretUnauthorizedError | 401 | application/json |
| errors.ExpireSecretNotFoundError | 404 | application/json |
| errors.ConvoyDefaultError | 4XX, 5XX | */* |
Toggles an endpoint's status between active and paused states
import { Convoy } from "convoy.js";
const convoy = new Convoy({
apiKeyAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await convoy.endpoints.pauseEndpoint("<id>", "<id>");
console.log(result);
}
run();The standalone function version of this method:
import { ConvoyCore } from "convoy.js/core.js";
import { endpointsPauseEndpoint } from "convoy.js/funcs/endpoints-pause-endpoint.js";
// Use `ConvoyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const convoy = new ConvoyCore({
apiKeyAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await endpointsPauseEndpoint(convoy, "<id>", "<id>");
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("endpointsPauseEndpoint failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
projectID |
string | ✔️ | Project ID |
endpointID |
string | ✔️ | Endpoint ID |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.PauseEndpointResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.PauseEndpointBadRequestError | 400 | application/json |
| errors.PauseEndpointUnauthorizedError | 401 | application/json |
| errors.PauseEndpointNotFoundError | 404 | application/json |
| errors.ConvoyDefaultError | 4XX, 5XX | */* |