FOR BUILDERS

Your code.
A new workflow.

Discover the proposed integration and prepare your application for the API.

Proposed contract. Endpoints, parameters and responses must be confirmed with the API team before real use.

Getting started

Integration has three steps: identify your application, create a task and follow its result. Explore the experience in the demo dashboard.

1Obtain a credential from the real service
2Create a task with its type and parameters
3Retrieve the result using its identifier

Authentication

The proposal uses a credential clientKey in server calls. Keep the key in environment variables, outside public code and the browser. Demo dashboard keys cannot access services.

Create a task

POST /createTask

Send the credential and required parameters for the selected type.

// Contrato proposto — configure a URL da API real no servidor
const response = await fetch(API_BASE_URL + "/createTask", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    clientKey: process.env.SOLUCAPTCHA_API_KEY,
    task: {
      type: "RecaptchaV2Task",
      websiteURL: "https://sua-aplicacao.com",
      websiteKey: "SUA_SITE_KEY"
    }
  })
});
if (!response.ok) throw new Error("Falha ao criar tarefa");
const task = await response.json();

Expected response

{
  "errorId": 0,
  "taskId": "example-task-id"
}

Retrieve the result

POST /getTaskResult

Use the taskId to check the state. If it is processing, wait before checking again, respecting API-defined intervals and limits.

{
  "clientKey": "SUA_CHAVE_NO_SERVIDOR",
  "taskId": "example-task-id"
}

States and errors

ready

The task has a result available.

processing

The task is still processing.

error

Check the returned error code and description.

Handle invalid credentials, insufficient balance, unexpected responses and timeouts. Final error names will be defined by the API.

Need help integrating?