API Reference

API reference for SonicClout platform

SonicClout provides a set of APIs for interacting with the platform programmatically. This reference documents the available endpoints, authentication requirements, and example requests.

Base URLs

  • Production API: https://api.sonicclout.io/v1

  • Staging API: https://api-staging.sonicclout.io/v1

  • Local Development: http://localhost:3001/v1

Authentication

Most API endpoints require authentication using a JWT token:

Authorization: Bearer <token>

To obtain a token, use the /auth/login endpoint with your credentials.

Rate Limiting

API requests are rate limited to:

  • 100 requests per minute for authenticated users

  • 20 requests per minute for unauthenticated users

Exceeding these limits will result in a 429 Too Many Requests response.

Content Endpoints

List Content

Returns a paginated list of content tokens.

Query Parameters

Parameter
Type
Description

page

number

Page number (default: 1)

limit

number

Items per page (default: 20, max: 100)

sort

string

Sort field (created_at, popularity, price)

order

string

Sort order (asc, desc)

creator

string

Filter by creator address

type

string

Filter by content type (post, image, video, etc.)

Response Example

Get Content Details

Returns detailed information about a specific content token.

Path Parameters

Parameter
Type
Description

id

string

Content ID

Response Example

Create Content

Creates a new content token.

Request Body

Response Example

Vesting Endpoints

List Vesting Schedules

Returns a list of vesting schedules for the authenticated user.

Response Example

Create Vesting Schedule

Creates a new vesting schedule.

Request Body

Response Example

Check Milestones

Checks milestone status for a vesting schedule.

Path Parameters

Parameter
Type
Description

id

string

Vesting schedule ID

Response Example

Trading Endpoints

Get Token Pairs

Returns available token pairs for trading.

Response Example

Get Swap Quote

Returns a quote for a token swap.

Query Parameters

Parameter
Type
Description

tokenIn

string

Input token ID or address

tokenOut

string

Output token ID or address

amountIn

string

Input amount (in smallest units)

slippage

number

Maximum slippage percentage

Response Example

User Endpoints

Get User Profile

Returns the profile of the authenticated user.

Response Example

Get Creator Profile

Returns the profile of a specific creator.

Path Parameters

Parameter
Type
Description

address

string

Creator's wallet address

Response Example

Error Responses

All API endpoints return standard error responses:

400 Bad Request

401 Unauthorized

403 Forbidden

404 Not Found

429 Too Many Requests

500 Internal Server Error

Webhooks

SonicClout provides webhooks for real-time event notifications. To set up a webhook:

  1. Register a webhook URL in your account settings

  2. Select the events you want to receive

  3. Implement an endpoint to receive the webhook events

Event Types

  • content.created - New content token created

  • vesting.milestone_reached - Vesting milestone reached

  • trade.completed - Trade transaction completed

  • bond.issued - New bond issued

  • bond.redeemed - Bond redeemed

Example Webhook Payload

Last updated