API

1. Auth

1.1. Request Nonce

Issues a unique nonce to start the authentication process.

POST /api/auth/nonce

Request

{}

Responses

Successful
{
  "nonce": "D8hHk...random-string..."
}

1.2. Verify Signature

Verifies the signed nonce. If valid, returns an authentication token.

POST /api/auth/verify

Request

{
  "nonce": "D8hHk...random-string...",
  "signature": "0xabcdef1234...signature"
}

Responses

Successful
{
  "token": "eyJhbGciOiJIUzI1NiIs...",
  "address": "0xabcd123..."
}

1.3. Retrieve Account

Returns the account information, including the deployment key used for task deployments.

GET /api/accounts/me
Authorization: Bearer <YOUR_AUTH_TOKEN>

Responses

Succesful
{
  "address": "0x123456789abcdef0000000000000000000001234",
  "deploymentKey": "DEPLOYMENT-KEY-1234-ABCD",
  "createdAt": "2025-01-06T11:00:00Z"
}

2. Tasks

2.1. Create

Records a newly deployed task and stores metadata so the registry can recognize it for future operations. The account calling this endpoint must provide a unique version for the task name given.

POST /api/tasks
Authorization: Bearer <YOUR_AUTH_TOKEN>

Request

{
  "cid": "bafybeigpecpfw5r7mxuaugil2htb64tl5sf5n3gvbu6h4uwq7d27zr6mau",
  "version": "1.0.0",
  "name": "Balance Monitoring Task",
  "description": "Monitors an account's token balance to create a swap intent if threshold is met."
}

Responses

Successful
{
  "taskId": "task_abc123",
  "cid": "bafybeigpecpfw5r7mxuaugil2htb64tl5sf5n3gvbu6h4uwq7d27zr6mau",
  "version": "1.0.0",  
  "name": "Balance Monitoring Task",
  "description": "Monitors an account's token balance to create a swap intent if threshold is met.",
  "createdAt": "2025-01-05T12:00:00Z"
}
Existing CID
{
  "statusCode": 409,
  "error": "Conflict",
  "message": "CID already registered."
}
Existing version
{
  "statusCode": 409,
  "error": "Conflict",
  "message": "A task named 'Balance Monitoring Task' (version 1.0.0) already exists for this user."
}

2.2. List Tasks

Retrieves all the tasks registered by the authenticated account.

GET /api/tasks
Authorization: Bearer <YOUR_AUTH_TOKEN>

Responses

Successful
[
  {
    "taskId": "task_abc123",
    "cid": "bafybeihqylwrgf2bdrxz57bdow2ie6xbxcxeb4smxkl7xwp7qlqawblg44",
    "name": "Balance Monitoring Task",
    "creator": "0x1234abcd...",
    "createdAt": "2025-01-05T12:00:00Z"
  },
  {
    "taskId": "task_456",
    "cid": "bafyreic4m73lpmds7muyuftykexy4tmn5pwy2du5byndq5jahy7mo6lzue",
    "name": "Arbitrage Task",
    "account": "0x1234abcd...",
    "createdAt": "2025-01-05T13:22:10Z"
  }
]

2.3. Get Task Info

Returns information about a specific task. No authentication required.

GET /api/tasks/:taskId

Responses

Successful
{
	"taskId": "task_abc123",
  "cid": "bafybeihqylwrgf2bdrxz57bdow2ie6xbxcxeb4smxkl7xwp7qlqawblg44",
  "name": "Balance Monitoring Task",
  "creator": "0x1234abcd...",
  "createdAt": "2025-01-05T12:00:00Z"
}


3. Projects

3.1. Create Project

Creates a new project under the authenticated user’s account.

POST /api/projects
Authorization: Bearer <YOUR_AUTH_TOKEN>

Request

{
  "name": "Fee collection"
}

Responses

Successful
{
  "projectId": "project_abc123",
  "name": "Fee collection",
  "tasks": [],
  "createdAt": "2025-01-05T12:00:00Z"
}

Associates a previously registered task with the specified project. The account calling this endpoint must have an owner role on the project to successfully link a task.

POST /api/projects/:projectId/tasks
Authorization: Bearer <YOUR_AUTH_TOKEN>

Request

{
    "taskId": "task_abc123"
}

Responses

Successful
{
  "projectId": "project_abc123",
  "taskId": "task_abc123"
}
No owner permissions
{
  "statusCode": 403,
  "error": "Forbidden",
  "message": "You must have owner permissions on this project to link a task."
}

Removes the association between a previously linked task and the specified project. The account calling this endpoint must have an owner role on the project to successfully link a task.

DELETE /api/projects/:projectId/tasks/:task_cid
Authorization: Bearer <YOUR_AUTH_TOKEN>

Responses

Successful
{
  "projectId": "project_abc123",
  "taskId": "task_abc123"
}
Now owner permissions
{
  "statusCode": 403,
  "error": "Forbidden",
  "message": "You must have owner permissions on this project to link a task."
}

3.4. Add Maintainer

Grants a secondary account privileges to upload task configs on the project. Only the owner can add maintainers, and they must provide a valid signature authorizing the addition.

POST /api/projects/:projectId/maintainers

Request

{
  "maintainer": "0x9876543210abcd9999efefcccc4444555599998888",
  "signature": "0x2653b3cc846f19613750d27f6a2f0f4c4a726ea6be9758d79c334233c8d2942cb991c10bc123fe03b9e60823534c4fa8c19339ffd2da02d38b46c0d4e3d30c2551666f"
}

Responses

Successful
{
  "projectId": "project_abc123",
  "maintainer": "0x9876543210abcd9999efefcccc4444555599998888",
  "signature": "0x2653b3cc846f19613750d27f6a2f0f4c4a726ea6be9758d79c334233c8d2942cb991c10bc123fe03b9e60823534c4fa8c19339ffd2da02d38b46c0d4e3d30c2551666f"
  "createdAt": "2025-01-06T10:00:00Z"
}
Invalid signature
{
  "statusCode": 401,
  "error": "Unauthorized",
  "message": "Invalid signature"
}

3.5. Remove Maintainer

Removes a specific maintainer associated to a project. This action deprecates the signature to make sure relayers don’t use it any more.

DELETE /api/projects/:projectId/maintainer/:address
Authorization: Bearer <YOUR_AUTH_TOKEN>

Responses

Successful
{
  "projectId": "project_abc123",
  "maintainer": "0x9876543210abcd9999efefcccc4444555599998888",
  "signature": "0x2653b3cc846f19613750d27f6a2f0f4c4a726ea6be9758d79c334233c8d2942cb991c10bc123fe03b9e60823534c4fa8c19339ffd2da02d38b46c0d4e3d30c2551666f"
  "createdAt": "2025-01-06T10:00:00Z"
}
Maintainer not found
{
  "statusCode": 404,
  "error": "Not Found",
  "message": "Maintainer 0x1234...4567 does not belong to the project"
}

3.6. Project Account Details

Returns the account information associated to a project.

GET /api/projects/:projectId/account
Authorization: Bearer <YOUR_AUTH_TOKEN>

Responses

Successful
{
  "roleId": "role_abc123",
  "projectId": "project_abc123",
  "account": "0x9876543210abcd9999efefcccc4444555599998888",
  "role": "owner",
  "projectKey": "PROJECT-KEY-1234-ABCD",
  "createdAt": "2025-01-06T12:00:00Z"
}

4. Configs

4.1. Create Config

Creates a configuration for a specific task within a project. The config must be specially signed by the account submitting the config.

POST /api/projects/:projectId/tasks/:taskId/configs

Request

{
  "name": "mainnet",
  "requriedOracleConfirmations": 1,
  "requriedRelayerConfirmations": 1,
  "signature": "0x2653b3cc846f19613750d27f6a2f0f4c4a726ea6be9758d79c334233c8d2942cb991c10bc123fe03b9e60823534c4fa8c19339ffd2da02d38b46c0d4e3d30c2551666f"
  "trigger": {
    "cron": "0 0 * * * *"
  },
  "data": {
    "threshold": 5000,
    "recipient": "0x789Abcd...",
  }
}

Responses

Succesful
{
  "projectId": "project_abc123",
  "taskId": "task_abc123",
  "configId": "config_abc123",	
  "signature": "0x2653b3cc846f19613750d27f6a2f0f4c4a726ea6be9758d79c334233c8d2942cb991c10bc123fe03b9e60823534c4fa8c19339ffd2da02d38b46c0d4e3d30c2551666f"  
  "createdAt": "2025-01-05T14:00:00Z",
  "data": {
    "threshold": 5000,
    "recipient": "0x789Abcd..."
  }
}

Invalid signature
{
  "statusCode": 401,
  "error": "Unauthorized",
  "message": "Invalid signature"
}

4.2. Delete Config

Removes a specific configuration associated with a task in a given project. This action deprecates the signature to make sure relayers don’t use it any more.

DELETE /api/projects/:projectId/tasks/:taskId/configs/:configId
Authorization: Bearer <YOUR_AUTH_TOKEN>

Responses

Successful
{
  "projectId": "project_abc123",
  "taskId": "task_abc123",
  "configId": "config_abc123",	
  "signature": "0x2653b3cc846f19613750d27f6a2f0f4c4a726ea6be9758d79c334233c8d2942cb991c10bc123fe03b9e60823534c4fa8c19339ffd2da02d38b46c0d4e3d30c2551666f"  
  "createdAt": "2025-01-05T14:00:00Z",
  "data": {
    "threshold": 5000,
    "recipient": "0x789Abcd..."
  }
}
Config not found
{
  "statusCode": 404,
  "error": "Not Found",
  "message": "Config config_abc123 does not belong to the project"
}

5. Executions

5.1. Submit Input

Submits a list of raw inputs for a task.

POST /api/tasks/:taskId/inputs

Request

{
  "configId": "config_abc123",
  "trigger": {
    "chainId": 1,
    "transactionHash": "0xdeb0c0627f7299735ce8fbb25cc4452cc96dba8f5b981947169ba117197c2d78",
    "logIndex": 0
  },
  "rawInputs": {
    "getRelevantTokens": [
      {
        "params": ["0xabfad5e5fee2fb5c4dd4a2952c309670f36cfc16"],
        "responses": [
          { 
	    "data": ["0x388C818CA8B9251b393131C08a736A67ccB19297", "0xdb65702a9b26f8a643a31a4c84b9392589e03d7c"],
	    "signature": "0x2653b3cc846f19613750d27f6a2f0f4c4a726ea6be9758d79c334233c8d2942cb991c10bc123fe03b9e60823534c4fa8c19339ffd2da02d38b46c0d4e3d30c2551",
            "timestamp": 8165348716
	  },
	  { 
	    "data": ["0x388C818CA8B9251b393131C08a736A67ccB19297"],
	    "signature": "0x0dd76a495c5770e448d070d3da38938f7914b10022ebaa16d6d3ccabed38c5b961f718bfe572d5a0f88f2923e384adc6c2b0628d35506f21201284e78b3e497ad3",
            "timestamp": 8165348712
	  },
        ]
      }
    ],
    "getPrice": [
      {
        "params": ["0x388C818CA8B9251b393131C08a736A67ccB19297"],
        "responses": [ 
          {            
	    "data": 192.57,
	    "signature": "0x2653b3cc846f19613750d27f6a2f0f4c4a726ea6be9758d79c334233c8d2942cb991c10bc123fe03b9e60823534c4fa8c19339ffd2da02d38b46c0d4e3d30c2551",
	    "timestamp": 8165348716
	  },
	  { 
	    "data": 190.56,
	    "signature": "0x0dd76a495c5770e448d070d3da38938f7914b10022ebaa16d6d3ccabed38c5b961f718bfe572d5a0f88f2923e384adc6c2b0628d35506f21201284e78b3e497ad3",
	    "timestamp": 8165348712
	  }
        ]
      },
      {  
        "params": ["0xdb65702a9b26f8a643a31a4c84b9392589e03d7c"], 
        "responses": [
          { 
   	    "data": 128.57,    
	    "signature": "0x2653b3cc846f19613750d27f6a2f0f4c4a726ea6be9758d79c334233c8d2942cb991c10bc123fe03b9e60823534c4fa8c19339ffd2da02d38b46c0d4e3d30c2551",
            "timestamp": 8165348716,
	  },
	  { 
	    "data": 128.56,	    
	    "signature": "0x0dd76a495c5770e448d070d3da38938f7914b10022ebaa16d6d3ccabed38c5b961f718bfe572d5a0f88f2923e384adc6c2b0628d35506f21201284e78b3e497ad3",
            "timestamp": 8165348712
          }
	]
      }	
    ]
  }
}

Responses

Successful
{
  "inputId": "input_abc123",
  "taskId": "task_abc123",
  "configId": "config_abc123",
  "trigger": {
    "chainId": 1,
    "transactionHash": "0xdeb0c0627f7299735ce8fbb25cc4452cc96dba8f5b981947169ba117197c2d78",
    "logIndex": 0
  },
  "inputs": [
    "relevantTokens": {
      "0xabfad5e5fee2fb5c4dd4a2952c309670f36cfc16": [
        "0x388C818CA8B9251b393131C08a736A67ccB19297", 
        "0xdb65702a9b26f8a643a31a4c84b9392589e03d7c"
      ]
    },
    "prices": [
      "0x388C818CA8B9251b393131C08a736A67ccB19297": 191.565,
      "0xdb65702a9b26f8a643a31a4c84b9392589e03d7c": 128.565
    ]
  }
}
Invalid oracle signature
{
  "statusCode": 401,
  "error": "Unauthorized",
  "message": "Invalid oracle signature for getRelevantTokens"
}
Outdated oracle data
{
  "statusCode": 409,
  "error": "Conflict",
  "message": "Outdated oracle response for getPrice"
}
Deprecated config
{
  "statusCode": 401,
  "error": "Unauthorized",
  "message": "Invalid config signature"
}
Required oracle confirmations not reached
{
  "statusCode": 409,
  "error": "Unauthorized",
  "message": "Config required oracle confirmations not reached"
}
Trigger already submitted
{
  "statusCode": 409,
  "error": "Conflict",
  "message": "Trigger already submitted"
}

5.2. Submit Execution

Submits a new execution for a task. Only allowed by relayers.

POST /api/tasks/:taskId/executions

Request

{
  "inputId": "input_abc123",
  "signature": "0x2653b3cc846f19613750d27f6a2f0f4c4a726ea6be9758d79c334233c8d2942cb991c10bc123fe03b9e60823534c4fa8c19339ffd2da02d38b46c0d4e3d30c2551",
  "intents": [
    { 
      "type": "swap",
      "data": {
        "from": "0xabfad5e5fee2fb5c4dd4a2952c309670f36cfc16",
	"to": "0xabfad5e5fee2fb5c4dd4a2952c309670f36cfc16",
	"chainId": 1,
	"tokenIn": "0x388C818CA8B9251b393131C08a736A67ccB19297",
	"tokenOut": "0xdb65702a9b26f8a643a31a4c84b9392589e03d7c",
	"amountIn": "9162399812",
	"minAmountOut": "19871982739123",
	"deadline": 9816239871
      }
    }
  ],
  "logs": [
    { 
      "timestamp": 761384681,
      "level": "success",
      "message": "Intent created"
    },
    { 
       "timestamp": 7613846123,
       "level": "debug",
       "message": "Task finished"
    },
  ]
}

Responses

Successful

Invalid relayer signature

5.3. List Executions

Lists all executions for a task.

GET /api/tasks/:taskId/executions
Authorization: Bearer <YOUR_AUTH_TOKEN>

Responses

Successful
{
  "data": [
    { 
      "executionId": "execution_abc123",
      "config": {
        "name": "mainnet",
        "requriedOracleConfirmations": 1,
        "requriedRelayerConfirmations": 1
      },      
      "trigger": {
	"chainId": 1,
	"transactionHash": "0xdeb0c0627f7299735ce8fbb25cc4452cc96dba8f5b981947169ba117197c2d78",
	"logIndex": 0
      },
      "input": {
        "count": 32,
        "inputId": "input_abc123"
      },
      "intents": 2
    }
  ],
  "page": 0,
  "total": 12397
}

5.4. Retrieve Execution

Retrieve an execution for a task

GET /api/tasks/:taskId/executions/:executionId
Authorization: Bearer <YOUR_AUTH_TOKEN>

Responses

Successful
{
  "configId": "config_abc123",
  "trigger": {
    "chainId": 1,
    "transactionHash": "0xdeb0c0627f7299735ce8fbb25cc4452cc96dba8f5b981947169ba117197c2d78",
    "logIndex": 0
  },
  "inputs": [
    "relevantTokens": {
      "0xabfad5e5fee2fb5c4dd4a2952c309670f36cfc16": [
        "0x388C818CA8B9251b393131C08a736A67ccB19297", 
        "0xdb65702a9b26f8a643a31a4c84b9392589e03d7c"
      ]
    },
    "prices": [
      "0x388C818CA8B9251b393131C08a736A67ccB19297": 191.565,
      "0xdb65702a9b26f8a643a31a4c84b9392589e03d7c": 128.565
    ]
  },
  "rawInputs": {
    "getRelevantTokens": [
      {
        "params": ["0xabfad5e5fee2fb5c4dd4a2952c309670f36cfc16"],
        "responses": [
          { 
	    "data": ["0x388C818CA8B9251b393131C08a736A67ccB19297", "0xdb65702a9b26f8a643a31a4c84b9392589e03d7c"],
	    "signature": "0x2653b3cc846f19613750d27f6a2f0f4c4a726ea6be9758d79c334233c8d2942cb991c10bc123fe03b9e60823534c4fa8c19339ffd2da02d38b46c0d4e3d30c2551",
            "timestamp": 8165348716
	  },
	  { 
	    "data": ["0x388C818CA8B9251b393131C08a736A67ccB19297"],
	    "signature": "0x0dd76a495c5770e448d070d3da38938f7914b10022ebaa16d6d3ccabed38c5b961f718bfe572d5a0f88f2923e384adc6c2b0628d35506f21201284e78b3e497ad3",
            "timestamp": 8165348712
	  },
        ]
      }
    ],
    "getPrice": [
      {
        "params": ["0x388C818CA8B9251b393131C08a736A67ccB19297"],
        "responses": [ 
          {            
	    "data": 192.57,
	    "signature": "0x2653b3cc846f19613750d27f6a2f0f4c4a726ea6be9758d79c334233c8d2942cb991c10bc123fe03b9e60823534c4fa8c19339ffd2da02d38b46c0d4e3d30c2551",
	    "timestamp": 8165348716
	  },
	  { 
	    "data": 190.56,
	    "signature": "0x0dd76a495c5770e448d070d3da38938f7914b10022ebaa16d6d3ccabed38c5b961f718bfe572d5a0f88f2923e384adc6c2b0628d35506f21201284e78b3e497ad3",
	    "timestamp": 8165348712
	  }
        ]
      },
      {  
        "params": ["0xdb65702a9b26f8a643a31a4c84b9392589e03d7c"], 
        "responses": [
          { 
   	    "data": 128.57,    
	    "signature": "0x2653b3cc846f19613750d27f6a2f0f4c4a726ea6be9758d79c334233c8d2942cb991c10bc123fe03b9e60823534c4fa8c19339ffd2da02d38b46c0d4e3d30c2551",
            "timestamp": 8165348716,
	  },
	  { 
	    "data": 128.56,	    
	    "signature": "0x0dd76a495c5770e448d070d3da38938f7914b10022ebaa16d6d3ccabed38c5b961f718bfe572d5a0f88f2923e384adc6c2b0628d35506f21201284e78b3e497ad3",
            "timestamp": 8165348712
          }
	]
      }	
    ]
  },
  "intents": [
    { 
      "intentId": "0xd0f06b72c2da76539653d18e61e9e898a21b9248f7f25f0525258f7fe3d399a0",
      "status": "submitted",
      "type": "swap",
      "data": {
        "from": "0xabfad5e5fee2fb5c4dd4a2952c309670f36cfc16",
	"to": "0xabfad5e5fee2fb5c4dd4a2952c309670f36cfc16",
	"chainId": 1,
	"tokenIn": "0x388C818CA8B9251b393131C08a736A67ccB19297",
	"tokenOut": "0xdb65702a9b26f8a643a31a4c84b9392589e03d7c",
	"amountIn": "9162399812",
	"minAmountOut": "19871982739123",
	"deadline": 9816239871
      }
    }
  ],
  "logs": [
    { 
      "timestamp": 761384681,
      "level": "success",
      "message": "Intent created"
    },
    { 
      "timestamp": 7613846123,
      "level": "debug",
      "message": "Task finished"
    }
  ],
  "proofs": [
    "0xdb65702a9b26f8a643a31a4c84b9392589e03d7c": "0x0dd76a495c5770e448d070d3da38938f7914b10022ebaa16d6d3ccabed38c5b961f718bfe572d5a0f88f2923e384adc6c2b0628d35506f21201284e78b3e497ad3",
    "0x388C818CA8B9251b393131C08a736A67ccB19297": "0x2653b3cc846f19613750d27f6a2f0f4c4a726ea6be9758d79c334233c8d2942cb991c10bc123fe03b9e60823534c4fa8c19339ffd2da02d38b46c0d4e3d30c2551"   
  ]
}

5.5. Retrieve Intent

Retrieve an execution intent

GET /api/tasks/:taskId/executions/:executionId/intents/:intentId
Authorization: Bearer <YOUR_AUTH_TOKEN>

Responses

Successful
{
  "status": "submitted",
  "type": "swap",
  "data": {
    "from": "0xabfad5e5fee2fb5c4dd4a2952c309670f36cfc16",
    "to": "0xabfad5e5fee2fb5c4dd4a2952c309670f36cfc16",
    "chainId": 1,
    "tokenIn": "0x388C818CA8B9251b393131C08a736A67ccB19297",
    "tokenOut": "0xdb65702a9b26f8a643a31a4c84b9392589e03d7c",
    "amountIn": "9162399812",
    "minAmountOut": "19871982739123",
    "deadline": 9816239871
  },
  "proposals": [
  
  ],
  "events": [
    { 
      "timestamp": 761384681,
      "level": "info",
      "message": "Intent received"
    },
    { 
      "timestamp": 7613846123,
      "level": "info",
      "message": "Proposal received from solver 0xdb65702a9b26f8a643a31a4c84b9392589e03d7c"
    },
    { 
      "timestamp": 7613846124,
      "level": "info",
      "message": "Proposal received from solver 0x388C818CA8B9251b393131C08a736A67ccB19297"
    },
    { 
      "timestamp": 7613846125,
      "level": "success",
      "message": "Proposal signed for solver 0x388C818CA8B9251b393131C08a736A67ccB19297"
    },
  ]
}

Last updated