API

Mimic API provides a secure and modular interface to automate tasks, and coordinate relayer-based executions across blockchains.

1. Authentication

1.1. Nonce

Request a new nonce for a wallet address. Used to initialize the signature-based login flow.

POST /users/nonce

Request

{
  "address": "address"
}

Response

{
  "address": "address",
  "nonce": "hash"
}

1.2. Authenticate

Authenticate a user by signing the nonce with their wallet.

POST /users/authenticate

Request

{
  "address": "address",
  "signature": "signature"
}

Response

{
  "address": "address",
  "token": "string"
}

2. Users

2.1. Api key

Fetch a user API key.

GET /users/api-key

Requires authentication with x-auth-token.

Response

{
  "address": "address",
  "apiKey": "string"
}

2.2. Tokens

Fetch a list of the user’s non-zero balances and allowances granted to settlers.

GET /users/tokens

Requires authentication with x-auth-token.

Response

[
  {
    "chainId": "number",
    "address": "address",
    "symbol": "string",
    "decimals": "number",
    "balance": "number",
    "allowance": "number"
  }
]

2.3. Quota

Fetch a user quota by its address.

GET /quotas/:address

Response

{
  "address": "address",
  "limit": "number",
  "executions": "number",
  "lastExecution": "ISO date"
}

3. Tasks

3.1. Create task

Upload a task manifest and files. Returns a CID pointing to the task.

POST /tasks

Requires authentication with x-api-key and file upload (multipart/form-data).

Response

{
  "CID": "CID",
  "name": "string",
  "version": "string",
  "description": "string",
  "creator": "address",
  "createdAt": "ISO date"
}

3.2. All tasks

Query tasks with optional filters.

GET /tasks

Query Parameters

  • cids: string[]

  • creator: Ethereum address

  • offset: number (default: 0)

  • limit: number (default: 20)

Response

[
  {
    "CID": "CID",
    "name": "string",
    "version": "string",
    "description": "string",
    "creator": "address",
    "createdAt": "ISO date"
  }
]

3.3. Find task

Retrieve a task by its CID.

GET /tasks/:cid

Response

{
  "CID": "CID",
  "name": "string",
  "version": "string",
  "description": "string",
  "creator": "address",
  "createdAt": "ISO date"
}

4. Configs

4.1. Create config

Create a new task configuration. Includes signature verification.

POST /configs

The types fields must be in the order they appear below. The Input elements must match the task manifest inputs, in the same order.

Request

{
  "description": "string",
  "typedData": {
    "types": {
      "Input": [{ "name": "string", "type": "string" }],
      "Trigger": [{ "name": "string", "type": "string" }],
      "Config": [{ "name": "string", "type": "string" }]
    },
    "values": {
      "taskCid": "CID",
      "version": "string (semver)",
      "input": {},
      "trigger": {}
    }
  },
  "sig": "signature"
}

Response

{
  "sig": "signature",
  "taskCid": "CID",
  "signer": "address",
  "active": true,
  "description": "string",
  "input": {},
  "trigger": {},
  "types": { "Input": [], "Trigger": [], "Config": []},
  "createdAt": "ISO date"
}

4.2. All configs

Fetch a list of task configurations with optional filters.

GET /configs

Query Parameters

  • sigs: string[]

  • taskCid: string (CID)

  • signer: Ethereum address

  • active: boolean

  • createdAfter: timestamp

  • createdBefore: timestamp

  • offset: number (default: 0)

  • limit: number (default: 20)

Response

[
  {
    "sig": "signature",
    "taskCid": "CID",
    "signer": "address",
    "active": "boolean",
    "description": "string",
    "input": {},
    "trigger": {},
    "types": { "Input": [], "Trigger": [], "Config": []},
    "createdAt": "ISO date"
  }
]

4.3. Find config

Fetch a specific task configuration by signature.

GET /configs/:sig

Response

{
  "sig": "signature",
  "taskCid": "CID",
  "signer": "address",
  "active": "boolean",
  "description": "string",
  "input": {},
  "trigger": {},
  "types": { "Input": [], "Trigger": [], "Config": []},
  "createdAt": "ISO date"
}

4.4. Deactivate config

Deactivates a specific task configuration by signature. Includes signature verification.

POST /configs/:sig/deactivate

This change cannot be reverted.

Request

{
  "deactivateSig": "signature"
}

Response

{
  "sig": "signature",
  "taskCid": "CID",
  "signer": "address",
  "active": false,
  "description": "string",
  "input": {},
  "trigger": {},
  "types": { "Input": [], "Trigger": [], "Config": []},
  "createdAt": "ISO date"
}

5. Executions

5.1. Create execution

Creates a new relayer task execution.

POST /executions

Request

{
  "taskCid": "CID",
  "configSig": "signature",
  "executionId": "string",
  "timestamp": "ISO date",
  "inputs": [
    { 
      "signature": "signature",
      "query": {},
      "result": {}
    }
  ],
  "outputs": [
    {
      "op": "number: { 0 (swap) | 1 (transfer) | 2 (call) }", 
      "user": "address",
      "settler": "address",
      "nonce": "hex",
      "deadline": "ISO date",
      "data": "hex",
    }
  ],
  "signature": "signature"
}

5.2. All executions

Fetch a list of relayer task executions with optional filters.

GET /executions

Query Parameters

  • configSig: string

  • createdAfter: timestamp

  • createdBefore: timestamp

  • offset: number (default: 0)

  • limit: number (default: 20)

Response

[
  {
    "relayer": "address",
    "taskCid": "CID",
    "configSig": "signature",
    "executionId": "string",
    "timestamp": "ISO date",
    "inputs": [
      { 
        "signature": "signature",
	"query": {},
	"result": {}
      }
    ],
    "outputs": [
      {
	"op": "number: { 0 (swap) | 1 (transfer) | 2 (call) }",
	"user": "address",
	"settler": "address",
	"nonce": "hex",
	"deadline": "ISO date",
	"data": "hex",
	"hash": "hex"
      }
    ],
    "signature": "signature",
    "validatorsNeeded": "number"
  }
]

5.3. Find execution

Fetch a specific relayer task execution by its ID. The response may include execution logs.

GET /executions/:executionId

Response

{
  "relayer": "address",
  "taskCid": "CID",
  "configSig": "signature",
  "executionId": "string",
  "timestamp": "ISO date",
  "inputs": [
    { 
      "signature": "signature",
      "query": {},
      "result": {}
    }
  ],
  "outputs": [
    {
      "op": "number: { 0 (swap) | 1 (transfer) | 2 (call) }",
      "user": "address",
      "settler": "address",
      "nonce": "hex",
      "deadline": "ISO date",
      "data": "hex",
      "hash": "hex"
    }
  ],
  "signature": "signature",
  "validatorsNeeded": "number",
  "logs": "optional string"
}

6. Intents

6.1. All intents

Fetch a list of intents with optional filters.

GET /intents

Query Parameters

  • user: address

  • settler: address

  • deadlineAfter: timestamp

  • deadlineBefore: timestamp

  • offset: number (default: 0)

  • limit: number (default: 20)

Response

[
  {
    "hash": "hex",
    "op": "number: { 0 (swap) | 1 (transfer) | 2 (call) }",
    "user": "address",
    "settler": "address",
    "nonce": "hex",
    "deadline": "ISO date",
    "data": "hex",
    "status": "string: { enqueued | discarded | submitted | succeeded | failed | expired }",
    "events": [
      {
        "level": "string: { info | success | error }",
        "data": "hex",
        "createdAt": "ISO date"
      }
    ],
    "proposals": [
      {
        "solver": "address",
        "data": "hex",
	"deadline": "ISO date",
	"description": "string",
	"signature": "signature",
	"transactionHash": "optional hex",
	"status": "string: { received | discarded | submitted | succeeded | failed }",
      }
    ]
  }
]

6.2. Find intent

Fetch a specific intent by its hash.

GET /intents/:hash

Response

{
  "hash": "hex",
  "op": "number: { 0 (swap) | 1 (transfer) | 2 (call) }",
  "user": "address",
  "settler": "address",
  "nonce": "hex",
  "deadline": "ISO date",
  "data": "hex",
  "status": "string: { enqueued | discarded | submitted | succeeded | failed | expired }",
  "events": [
    {
      "level": "string: { info | success | error }",
      "data": "hex",
      "createdAt": "ISO date"
    }
  ],
  "proposals": [
    {
      "solver": "address",
      "data": "hex",
      "deadline": "ISO date",
      "description": "string",
      "signature": "signature",
      "transactionHash": "optional hex",
      "status": "string: { received | discarded | submitted | succeeded | failed }",
    }
  ]
}

7. Miscellaneous

7.1. Settlers

Fetch a list of enabled settlers.

GET /settlers

Response

{
  "chainId": "number",
  "address": "address",
  "createdAt": "ISO date"
}

8.2. Health

Check API status.

GET /health

Response

200 'OK'

Last updated