Quickstart
This guide takes your integration from a new credential to a 201 from
POST /api/v1/envelopes: an envelope created in your organization.
Requirements: a bb-sign account with the org admin role (or help from someone who has it), and Java 17 or newer, or Node 20 or newer.
1. Get a credential
Section titled “1. Get a credential”An API credential lets a system call bb-sign on your organization’s behalf, with access limited to that organization.
- Sign in to bb-sign and open Settings, tab API credentials.
- Select New credential. Give it a label that identifies the system that will use it, for example “Billing system”.
- Under Access, keep the default workspace and role unless you need others: “General with Manager is the default.”
- Copy the Client ID and the Client secret.
Settings appears in the sidebar for org admins. If you do not have that role, ask your organization’s bb-sign admin to create the credential and send you the two values.
You also need two URLs. In production they are:
| Value | |
|---|---|
| API base URL | https://sign-api.binarybridges.co |
| Token URL | https://auth.binarybridges.co/realms/bbsign/protocol/openid-connect/token |
Set them as environment variables, outside your source code:
export BBSIGN_BASE_URL="https://sign-api.binarybridges.co"export BBSIGN_TOKEN_URL="https://auth.binarybridges.co/realms/bbsign/protocol/openid-connect/token"export BBSIGN_CLIENT_ID="..."export BBSIGN_CLIENT_SECRET="..."2. Verify the credential
Section titled “2. Verify the credential”Before writing code, confirm the credential obtains a token:
curl -s -X POST "$BBSIGN_TOKEN_URL" \ -d grant_type=client_credentials \ -d client_id="$BBSIGN_CLIENT_ID" \ -d client_secret="$BBSIGN_CLIENT_SECRET"The response is JSON with access_token. If you receive invalid_client, the id or secret is
wrong: copy them again, or rotate the secret and try again.
With the credential verified, any later failure is easier to diagnose.
3. Install an SDK
Section titled “3. Install an SDK”The API is standard HTTP and the reference documents it in full, so the SDK is optional. The SDKs handle token refresh, retries and webhook signature verification.
No installation required. The examples use curl and jq.
The SDK is delivered as a tarball:
npm install ./binarybridges-bb-sign-sdk-0.1.0.tgzRequires Node 20 or newer, and the package is ESM only: use
import instead of require. More details in JavaScript SDK.
The SDK is delivered as four files. Install the jar into your local Maven repository:
shasum -a 256 -c bb-sign-sdk-java-0.1.0-SNAPSHOT.jar.sha256
mvn install:install-file \ -Dfile=bb-sign-sdk-java-0.1.0-SNAPSHOT.jar \ -DpomFile=bb-sign-sdk-java-0.1.0-SNAPSHOT.pom-DpomFile is required. Without it, Maven generates a pom with no dependencies: the install
and the build complete without errors, but the first API call fails at runtime with
NoClassDefFoundError.
<dependency> <groupId>co.binarybridges.sign</groupId> <artifactId>bb-sign-sdk-java</artifactId> <version>0.1.0-SNAPSHOT</version></dependency>More details in Java SDK.
4. Create an envelope
Section titled “4. Create an envelope”TOKEN=$(curl -s -X POST "$BBSIGN_TOKEN_URL" \ -d grant_type=client_credentials \ -d client_id="$BBSIGN_CLIENT_ID" \ -d client_secret="$BBSIGN_CLIENT_SECRET" | jq -r .access_token)
curl -s -X POST "$BBSIGN_BASE_URL/api/v1/envelopes" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "title": "My first envelope", "otpRequired": false, "expiresAt": "2026-12-01T00:00:00Z", "signers": [{"email": "someone@example.com", "name": "Someone", "signOrder": 1}] }'import { createClient } from '@binarybridges/bb-sign-sdk'
const client = createClient({ baseUrl: process.env.BBSIGN_BASE_URL, tokenUrl: process.env.BBSIGN_TOKEN_URL, clientId: process.env.BBSIGN_CLIENT_ID, clientSecret: process.env.BBSIGN_CLIENT_SECRET,})
const envelope = await client.envelopes.createEnvelope({ createEnvelopeRequest: { title: 'My first envelope', otpRequired: false, expiresAt: new Date(Date.now() + 72 * 3600 * 1000), signers: [{ email: 'someone@example.com', name: 'Someone', signOrder: 1 }], },})
console.log('Created', envelope.id)import co.binarybridges.sign.sdk.BbSignClient;import co.binarybridges.sign.sdk.generated.model.*;import java.time.OffsetDateTime;import java.util.List;
try (BbSignClient client = BbSignClient.builder() .baseUrl(System.getenv("BBSIGN_BASE_URL")) .tokenUrl(System.getenv("BBSIGN_TOKEN_URL")) .clientCredentials(System.getenv("BBSIGN_CLIENT_ID"), System.getenv("BBSIGN_CLIENT_SECRET")) .build()) {
EnvelopeResponse envelope = client.execute(client.envelopes().createEnvelope( new CreateEnvelopeRequest() .title("My first envelope") .otpRequired(false) .expiresAt(OffsetDateTime.now().plusHours(72)) .signers(List.of(new CreateSignerSpec() .email("someone@example.com") .name("Someone") .signOrder(1)))));
System.out.println("Created " + envelope.getId());}The 201 response confirms the envelope exists, in DRAFT status.
Choose a workspace
Section titled “Choose a workspace”Every envelope belongs to a workspace, and a credential accesses the workspaces assigned to it.
A new credential is Manager in your organization’s General workspace unless the admin chose
another. Without workspaceId, the envelope is filed in General. To file it in another workspace,
list the workspaces available to the credential and send one’s id:
curl -s "$BBSIGN_BASE_URL/api/v1/workspaces" -H "Authorization: Bearer $TOKEN"# [{"id":"6f1c...","name":"General","isGeneral":true}, {"id":"a2d9...","name":"HR","isGeneral":false}]
curl -s -X POST "$BBSIGN_BASE_URL/api/v1/envelopes" \ -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \ -d '{"title": "Offer letter", "workspaceId": "a2d9...", "signers": [{"email": "someone@example.com", "name": "Someone"}]}'A workspace the credential cannot create in returns 404 WORKSPACE_NOT_FOUND, the same as one
that does not exist. Envelopes in workspaces without access return 404 NOT_FOUND and do not
appear in lists.
5. Send the envelope for signature
Section titled “5. Send the envelope for signature”An envelope in DRAFT has not been sent yet. For the signers to receive it:
- Attach a document:
POST /api/v1/envelopes/{id}/documents(multipart), or upload it first withPOST /api/v1/documentsand send the ids asdocumentIdswhen you create the envelope. - Send it:
POST /api/v1/envelopes/{id}/send. bb-sign emails each signer a link and returns their signing tokens. From this point on, the documents and signers are fixed. - Receive status changes: set up a webhook instead of polling.
From credential to signed document shows each of these calls in the three languages.
Troubleshooting
Section titled “Troubleshooting”| Symptom | Meaning | Action |
|---|---|---|
invalid_client from the token URL |
The client id or secret is wrong | Copy them again or rotate the secret |
401 from the API |
The token was rejected or has expired (a token is valid for 300 s) | If you built the request manually, check the Bearer prefix; request a new token |
403 |
The credential is valid, but the operation is not available to credentials | Confirm the operation is listed in the API reference; administration is done in the UI |
404 WORKSPACE_NOT_FOUND |
The credential has no role that allows creating in that workspace, or the workspace does not exist | Omit workspaceId, or ask the admin to grant the credential a role in that workspace from Settings, tab Workspaces |
400 with no detail |
Usually a malformed body | Compare it field by field with the example; expiresAt must be ISO-8601 |
NoClassDefFoundError at runtime (Java) |
-DpomFile was omitted during install |
Reinstall with that parameter |
ERR_REQUIRE_ESM (JavaScript) |
The package is ESM only | Use import |
If your case is not in the table, write to us with a description of what you were doing.
Reference
Section titled “Reference”- API reference: every endpoint, generated from the contract.
- Webhooks: receive events and verify their origin.
- Migrating from Adobe Acrobat Sign: concept mapping.
openapi.json: the machine-readable contract, to generate your own client.