onoFa
خدماتTvدونوویجت هابپلن‌هاوبلاگدرباره ما
شروع کنید
صفحه اصلی
خدمات
Tvدونو
ویجت هاب
پلن‌ها
وبلاگ
درباره ما

منابع

  • کاربران برتر
  • Tvدونو
  • وبلاگ

خدمات

  • تعرفه‌ها
  • مستندات
  • وضعیت سرویس‌ها
  • برنامه اشتراک فایل
onoFa
خدماتTvدونوویجت هابپلن‌هاوبلاگدرباره ما
شروع کنید
صفحه اصلی
خدمات
Tvدونو
ویجت هاب
پلن‌ها
وبلاگ
درباره ما

منابع

  • کاربران برتر
  • Tvدونو
  • وبلاگ

خدمات

  • تعرفه‌ها
  • مستندات
  • وضعیت سرویس‌ها
  • برنامه اشتراک فایل
Donofa API
Ctrl K
OverviewAuthentication
GETCurrent goalPOSTUpdate GoalGETCurrent timerGETDonation historyGETLatest donations
GETList goalsPOSTCreate goalGETGet default goalPOSTModify goalPOSTReset goalGETDonation historyGETLatest donationsGETTop donationsGETGet timerPOSTPause timerPOSTResume timerPOSTReset timerPOSTExtend timer
EVENT.donate.createdEVENT.goal.updatedEVENT.goal.completedEVENT.timer.updatedEVENT.tts.created
18 endpoints5 events
API reference

Donofa API

Use the .ir API from Iranian users and hosts for the best domestic route. Use the .com API from outside Iran.

Iran APIRecommended for users and hosts inside Iran
https://api.donofa.ir
Global APIRecommended for users and hosts outside Iran
https://api.donofa.com
WebSocketLaravel Reverb / Pusher protocol over TLS (port 443)
wss://ws.donofa.com/app/AF5Ed2JK
Reverb App KeyPublic WebSocket connection credential
AF5Ed2JK
Security

Authentication

Use Authorization: Api <API_KEY> for every HTTP endpoint below. Keep the key secret and never commit it to client code.

SchemeAPI key
TypeApi
Locationheader
HeaderAuthorization
Endpoints

API v1

Legacy endpoints retained for integrations that have not moved to v2.

get/api/v1/widgets/goal

Current goal

Returns the first non-deleted goal, ordered by descending sort value.

Authentication

Send the API key in the Authorization header for this endpoint.

Responses
200

Goal returned.

application/json
404

The user has no non-deleted goal.

401

Missing or invalid API key.

application/json
429

Rate limit exceeded.

application/json
cURLShell
curl -X GET \
  "https://api.donofa.ir/api/v1/widgets/goal" \
  -H "Authorization: Api <API_KEY>"
Response 200JSON
{
  "status": true,
  "message": "Goal",
  "goal": {
    "identifier": null,
    "title": "Monthly support",
    "amount": 5000000,
    "filled": 1850000
  },
  "code": 200
}
post/api/v1/widgets/goal

Update Goal

Always returns a deprecation error. Use the v2 goal endpoints instead.

Authentication

Send the API key in the Authorization header for this endpoint.

Responses
400

This endpoint is deprecated.

application/json
401

Missing or invalid API key.

application/json
429

Rate limit exceeded.

application/json
cURLShell
curl -X POST \
  "https://api.donofa.ir/api/v1/widgets/goal" \
  -H "Authorization: Api <API_KEY>"
Response 400JSON
{
  "status": false,
  "message": "This route is deprecated consider using new api version (docs.donofa.ir) or contact support at once.",
  "code": 400
}
get/api/v1/widgets/timer

Current timer

Returns legacy timer state and the donation-to-seconds rate.

Authentication

Send the API key in the Authorization header for this endpoint.

Responses
200

Timer returned.

application/json
401

Missing or invalid API key.

application/json
429

Rate limit exceeded.

application/json
cURLShell
curl -X GET \
  "https://api.donofa.ir/api/v1/widgets/timer" \
  -H "Authorization: Api <API_KEY>"
Response 200JSON
{
  "status": true,
  "message": "Goal",
  "timer": {
    "identifier": null,
    "title": null,
    "rate": 10000,
    "ends_at": 1788070800,
    "ends_in": 3600,
    "is_active": true
  },
  "code": 200
}
get/api/v1/donates

Donation history

Returns the authenticated user's filtered, paginated donations.

Authentication

Send the API key in the Authorization header for this endpoint.

Parameters
pagequery

Page number; default 1.

integer
per_pagequery

Items per page; default 15.

integer
fromAmount / toAmountquery

Inclusive amount bounds.

number
fromDate / toDatequery

Inclusive created date bounds.

date
daysquery

Only records from the last N days.

integer
statusquery

1 paid, 2 pending, or 3 refunded.

integer
typequery

Comma-separated donation types.

string
qquery

Search donor name or message.

string
order_byquery

Created date order; default desc.

asc | desc
limitquery

Optional query limit.

integer
Responses
200

Donation page returned.

application/json
401

Missing or invalid API key.

application/json
429

Rate limit exceeded.

application/json
cURLShell
curl -H "Authorization: Api <API_KEY>" "https://api.donofa.ir/api/v1/donates?page=1&per_page=15&status=1"
Response 200JSON
{
  "status": true,
  "donates": [
    {
      "id": 501,
      "name": "Ali",
      "email": "ali@example.com",
      "phone": "+989121234567",
      "description": "Keep going!",
      "type": "IRT",
      "amount": 500000,
      "currency": "IRT",
      "meta": {},
      "status": 1,
      "is_visible": true,
      "is_blocked": false,
      "created_at": "2026-08-30T10:20:00.000000Z"
    }
  ],
  "pages": 4
}
get/api/v1/donates/last

Latest donations

Returns the latest 20 donations, newest first.

Authentication

Send the API key in the Authorization header for this endpoint.

Responses
200

Latest donations returned.

application/json
401

Missing or invalid API key.

application/json
429

Rate limit exceeded.

application/json
cURLShell
curl -X GET \
  "https://api.donofa.ir/api/v1/donates/last" \
  -H "Authorization: Api <API_KEY>"
Response 200JSON
{
  "status": true,
  "donates": [
    {
      "id": 501,
      "name": "Ali",
      "email": "ali@example.com",
      "phone": "+989121234567",
      "description": "Keep going!",
      "type": "IRT",
      "amount": 500000,
      "currency": "IRT",
      "meta": {},
      "status": 1,
      "is_visible": true,
      "is_blocked": false,
      "created_at": "2026-08-30T10:20:00.000000Z"
    }
  ]
}
Endpoints

API v2

Current goal, donation, and timer endpoints.

get/api/v2/goals

List goals

Returns all non-deleted goals, ordered by descending sort value.

Authentication

Send the API key in the Authorization header for this endpoint.

Responses
200

Goals returned.

application/json
401

Missing or invalid API key.

application/json
429

Rate limit exceeded.

application/json
cURLShell
curl -X GET \
  "https://api.donofa.ir/api/v2/goals" \
  -H "Authorization: Api <API_KEY>"
Response 200JSON
{
  "status": true,
  "message": "Goals",
  "goals": [
    {
      "id": 12,
      "title": "Monthly support",
      "unit": "IRT",
      "initial": 0,
      "progress": 1850000,
      "total": 5000000,
      "media": [],
      "sources": {
        "donation": {
          "irt": true
        }
      },
      "meta": {
        "dynamic": true
      },
      "sort": 1,
      "status": "pending",
      "is_active": true,
      "is_default": false,
      "created_at": "2026-08-01T10:00:00.000000Z"
    }
  ],
  "code": 200
}
post/api/v2/goals

Create goal

Creates a goal. Progress starts at the supplied initial value.

Authentication

Send the API key in the Authorization header for this endpoint.

Request body
multipart/form-data
titlerequired

Goal title.

string (2-30)
unitrequired

Goal unit; create only.

IRT | USD | piece
initialrequired

Initial progress.

integer >= 0
totalrequired

Target total.

integer > 0
media[]

Up to four images.

image <= 4 MB
meta.product_link

Optional active product URL.

URL
meta.dynamic

Dynamic goal flag.

boolean
sources

Donation/follow/sub/points source switches.

object
Responses
200

Goal created.

application/json
403

The plan's maximum active-goal count was reached.

422

A field failed validation.

401

Missing or invalid API key.

application/json
429

Rate limit exceeded.

application/json
cURLShell
curl -X POST "https://api.donofa.ir/api/v2/goals" -H "Authorization: Api <API_KEY>" -F "title=Monthly support" -F "unit=IRT" -F "initial=0" -F "total=5000000"
Response 200JSON
{
  "status": true,
  "message": "Goal created successfully.",
  "goal": {
    "id": 12,
    "title": "Monthly support",
    "unit": "IRT",
    "initial": 0,
    "progress": 1850000,
    "total": 5000000,
    "media": [],
    "sources": {
      "donation": {
        "irt": true
      }
    },
    "meta": {
      "dynamic": true
    },
    "sort": 1,
    "status": "pending",
    "is_active": true,
    "is_default": false,
    "created_at": "2026-08-01T10:00:00.000000Z"
  },
  "code": 200
}
get/api/v2/goals/default

Get default goal

Returns the first non-deleted goal by descending sort value.

Authentication

Send the API key in the Authorization header for this endpoint.

Responses
200

Default goal returned.

application/json
404

The user has no non-deleted goal.

401

Missing or invalid API key.

application/json
429

Rate limit exceeded.

application/json
cURLShell
curl -X GET \
  "https://api.donofa.ir/api/v2/goals/default" \
  -H "Authorization: Api <API_KEY>"
Response 200JSON
{
  "status": true,
  "message": "Default Goal",
  "goal": {
    "id": 12,
    "title": "Monthly support",
    "unit": "IRT",
    "initial": 0,
    "progress": 1850000,
    "total": 5000000,
    "media": [],
    "sources": {
      "donation": {
        "irt": true
      }
    },
    "meta": {
      "dynamic": true
    },
    "sort": 1,
    "status": "pending",
    "is_active": true,
    "is_default": false,
    "created_at": "2026-08-01T10:00:00.000000Z"
  },
  "code": 200
}
post/api/v2/goals/{goal}

Modify goal

Updates a goal owned by the authenticated user. Sending media replaces existing media.

Authentication

Send the API key in the Authorization header for this endpoint.

Request body
multipart/form-data
title

Goal title.

string (2-30)
initial

Initial progress.

integer >= 0
total

Target total.

integer > 0
media[]

Up to four images.

image <= 4 MB
meta.product_link

Optional active product URL.

URL
meta.dynamic

Dynamic goal flag.

boolean
sources

Donation/follow/sub/points source switches.

object
sort

Display order.

integer >= 0
Responses
200

Goal updated and goal.updated broadcast.

application/json
403

The goal belongs to another user.

404

Goal ID does not exist.

422

A field failed validation.

401

Missing or invalid API key.

application/json
429

Rate limit exceeded.

application/json
cURLShell
curl -X POST \
  "https://api.donofa.ir/api/v2/goals/{goal}" \
  -H "Authorization: Api <API_KEY>"
Response 200JSON
{
  "status": true,
  "message": "Goal updated successfully.",
  "goal": {
    "id": 12,
    "title": "Monthly support",
    "unit": "IRT",
    "initial": 0,
    "progress": 1850000,
    "total": 5000000,
    "media": [],
    "sources": {
      "donation": {
        "irt": true
      }
    },
    "meta": {
      "dynamic": true
    },
    "sort": 1,
    "status": "pending",
    "is_active": true,
    "is_default": false,
    "created_at": "2026-08-01T10:00:00.000000Z"
  },
  "code": 200
}
post/api/v2/goals/{goal}/reset

Reset goal

Resets progress to initial and status to pending.

Authentication

Send the API key in the Authorization header for this endpoint.

Responses
200

Goal reset and goal.updated broadcast.

application/json
403

The goal belongs to another user.

404

Goal ID does not exist.

401

Missing or invalid API key.

application/json
429

Rate limit exceeded.

application/json
cURLShell
curl -X POST \
  "https://api.donofa.ir/api/v2/goals/{goal}/reset" \
  -H "Authorization: Api <API_KEY>"
Response 200JSON
{
  "status": true,
  "message": "Goal reset successfully.",
  "goal": {
    "id": 12,
    "title": "Monthly support",
    "unit": "IRT",
    "initial": 0,
    "progress": 1850000,
    "total": 5000000,
    "media": [],
    "sources": {
      "donation": {
        "irt": true
      }
    },
    "meta": {
      "dynamic": true
    },
    "sort": 1,
    "status": "pending",
    "is_active": true,
    "is_default": false,
    "created_at": "2026-08-01T10:00:00.000000Z"
  },
  "code": 200
}
get/api/v2/donates

Donation history

Returns filtered, paginated donations in the current resource format.

Authentication

Send the API key in the Authorization header for this endpoint.

Parameters
page / per_pagequery

Page and page size; defaults 1 and 15.

integer
fromAmount / toAmountquery

Inclusive amount bounds.

number
fromDate / toDatequery

Inclusive created date bounds.

date
daysquery

Only records from the last N days.

integer
statusquery

Donation status value.

string
typequery

Comma-separated donation types.

string
qquery

Search donor name or message.

string
order_byquery

Created date order; default desc.

asc | desc
limitquery

Optional query limit.

integer
Responses
200

Donation page returned.

application/json
401

Missing or invalid API key.

application/json
429

Rate limit exceeded.

application/json
cURLShell
curl -X GET \
  "https://api.donofa.ir/api/v2/donates" \
  -H "Authorization: Api <API_KEY>"
Response 200JSON
{
  "status": true,
  "message": "Donates",
  "donates": [
    {
      "id": 501,
      "type": "IRT",
      "currency": "IRT",
      "amount": 500000,
      "name": "Ali",
      "message": "Keep going!",
      "phone": "+989121234567",
      "email": "ali@example.com",
      "ip": "203.0.113.10",
      "visible": true,
      "status": "paid",
      "meta": {},
      "details": {},
      "addons": {
        "voice": false,
        "tts": false
      },
      "is_visible": true,
      "created_at": "2026-08-30T10:20:00.000000Z"
    }
  ],
  "pages": 4,
  "code": 200
}
get/api/v2/donates/last

Latest donations

Returns latest donation statistics.

Authentication

Send the API key in the Authorization header for this endpoint.

Parameters
limitquery

Maximum results; default 10, capped at 100.

integer
Responses
200

Latest donations returned.

application/json
401

Missing or invalid API key.

application/json
429

Rate limit exceeded.

application/json
cURLShell
curl -X GET \
  "https://api.donofa.ir/api/v2/donates/last" \
  -H "Authorization: Api <API_KEY>"
Response 200JSON
{
  "status": true,
  "message": "Last Donates",
  "donates": [
    {
      "name": "Ali",
      "amount": 500000,
      "created_at": "2026-08-30T10:20:00.000000Z"
    }
  ],
  "code": 200
}
get/api/v2/donates/top

Top donations

Returns highest donation statistics for a period.

Authentication

Send the API key in the Authorization header for this endpoint.

Parameters
limitquery

Maximum results; default 10, capped at 100.

integer
periodquery

Statistics period; default last30d.

string
aggregationquery

Aggregate donors; default false.

true | false
Responses
200

Top donations returned.

application/json
401

Missing or invalid API key.

application/json
429

Rate limit exceeded.

application/json
cURLShell
curl -X GET \
  "https://api.donofa.ir/api/v2/donates/top" \
  -H "Authorization: Api <API_KEY>"
Response 200JSON
{
  "status": true,
  "message": "Top Donates",
  "donates": [
    {
      "name": "Ali",
      "amount": 2500000
    }
  ],
  "code": 200
}
get/api/v2/timer

Get timer

Returns the authenticated user's timer.

Authentication

Send the API key in the Authorization header for this endpoint.

Responses
200

Timer returned.

application/json
401

Missing or invalid API key.

application/json
429

Rate limit exceeded.

application/json
cURLShell
curl -X GET \
  "https://api.donofa.ir/api/v2/timer" \
  -H "Authorization: Api <API_KEY>"
Response 200JSON
{
  "status": true,
  "message": "Timer",
  "timer": {
    "id": 7,
    "initial": 3600,
    "started_at": "2026-08-30T10:00:00.000000Z",
    "ends_at": "2026-08-30T11:00:00.000000Z",
    "paused_at": null,
    "finished_at": null,
    "remaining": 3600,
    "rates": {
      "donation": {
        "amount": 10000,
        "seconds": 60
      }
    },
    "status": "running",
    "is_visible": true,
    "is_decreasable": true,
    "created_at": "2026-08-01T10:00:00.000000Z"
  },
  "code": 200
}
post/api/v2/timer/pause

Pause timer

Pauses the timer and broadcasts timer.updated.

Authentication

Send the API key in the Authorization header for this endpoint.

Responses
200

Timer action completed.

application/json
401

Missing or invalid API key.

application/json
429

Rate limit exceeded.

application/json
cURLShell
curl -X POST \
  "https://api.donofa.ir/api/v2/timer/pause" \
  -H "Authorization: Api <API_KEY>"
Response 200JSON
{
  "status": true,
  "message": "Timer paused successfully.",
  "code": 200
}
post/api/v2/timer/resume

Resume timer

Resumes the timer and broadcasts timer.updated.

Authentication

Send the API key in the Authorization header for this endpoint.

Responses
200

Timer action completed.

application/json
401

Missing or invalid API key.

application/json
429

Rate limit exceeded.

application/json
cURLShell
curl -X POST \
  "https://api.donofa.ir/api/v2/timer/resume" \
  -H "Authorization: Api <API_KEY>"
Response 200JSON
{
  "status": true,
  "message": "Timer resumed successfully.",
  "code": 200
}
post/api/v2/timer/reset

Reset timer

Resets the timer and broadcasts timer.updated.

Authentication

Send the API key in the Authorization header for this endpoint.

Responses
200

Timer action completed.

application/json
401

Missing or invalid API key.

application/json
429

Rate limit exceeded.

application/json
cURLShell
curl -X POST \
  "https://api.donofa.ir/api/v2/timer/reset" \
  -H "Authorization: Api <API_KEY>"
Response 200JSON
{
  "status": true,
  "message": "Timer reset successfully.",
  "code": 200
}
post/api/v2/timer/extend

Extend timer

Adds seconds to the timer and broadcasts timer.updated.

Authentication

Send the API key in the Authorization header for this endpoint.

Request body
application/json
secondsrequired

Seconds to add.

integer > 0
Body exampleJSON
{
  "seconds": 300
}
Responses
200

Timer extended.

application/json
422

Seconds is missing, non-integer, or not positive.

401

Missing or invalid API key.

application/json
429

Rate limit exceeded.

application/json
cURLShell
curl -X POST \
  "https://api.donofa.ir/api/v2/timer/extend" \
  -H "Authorization: Api <API_KEY>" \
  -H "Content-Type: application/json" \
  --data '{"seconds":300}'
Response 200JSON
{
  "status": true,
  "message": "Timer extended successfully.",
  "code": 200
}
Real-time

WebSockets

Subscribe with Echo.channel('user.<API_KEY>') to receive user events.

ChannelPusher protocol / Laravel Reverb
user.<API_KEY>
guideConnection setup

Subscribe to user events

Reverb uses the Pusher protocol. With Laravel Echo, custom event names require the leading dot. With a native WebSocket client, subscribe after the connection is established.

Laravel EchoJavaScript
import Echo from 'laravel-echo'
import Pusher from 'pusher-js'

const echo = new Echo({
  broadcaster: 'reverb',
  client: new Pusher('AF5Ed2JK', {
    wsHost: 'ws.donofa.com',
    wsPort: 443,
    wssPort: 443,
    forceTLS: true,
    enabledTransports: ['ws', 'wss'],
  }),
})

echo.channel('user.<API_KEY>')
  .listen('.donate.created', donate => console.log(donate))
  .listen('.goal.updated', goal => console.log(goal))
  .listen('.goal.completed', goal => console.log(goal))
  .listen('.timer.updated', timer => console.log(timer))
  .listen('.tts.created', ({ url }) => console.log(url))
Native WebSocketJavaScript
const socket = new WebSocket(
  'wss://ws.donofa.com/app/AF5Ed2JK?protocol=7&client=js&version=8.5.0'
)

socket.send(JSON.stringify({
  event: 'pusher:subscribe',
  data: { channel: 'user.<API_KEY>' },
}))

socket.addEventListener('message', event => {
  const message = JSON.parse(event.data)
  const supported = [
    'donate.created',
    'goal.updated',
    'goal.completed',
    'timer.updated',
    'tts.created',
  ]

  if (supported.includes(message.event)) {
    console.log(message.event, JSON.parse(message.data))
  }
})
event.donate.created

DonateResource

Unwrapped donation object. Voice, TTS, goal, and withdrawable fields appear only when available.

Payload exampleJSON
{
  "id": 501,
  "type": "IRT",
  "currency": "IRT",
  "amount": 500000,
  "name": "Ali",
  "message": "Keep going!",
  "phone": "+989121234567",
  "email": "ali@example.com",
  "ip": "203.0.113.10",
  "visible": true,
  "status": "paid",
  "meta": {},
  "details": {},
  "addons": {
    "voice": false,
    "tts": false
  },
  "is_visible": true,
  "created_at": "2026-08-30T10:20:00.000000Z"
}
event.goal.updated

GoalResource

Complete updated goal resource.

Payload exampleJSON
{
  "id": 12,
  "title": "Monthly support",
  "unit": "IRT",
  "initial": 0,
  "progress": 1850000,
  "total": 5000000,
  "media": [],
  "sources": {
    "donation": {
      "irt": true
    }
  },
  "meta": {
    "dynamic": true
  },
  "sort": 1,
  "status": "pending",
  "is_active": true,
  "is_default": false,
  "created_at": "2026-08-01T10:00:00.000000Z"
}
event.goal.completed

GoalResource

Complete goal resource after the goal reaches its target.

Payload exampleJSON
{
  "id": 12,
  "title": "Monthly support",
  "unit": "IRT",
  "initial": 0,
  "progress": 1850000,
  "total": 5000000,
  "media": [],
  "sources": {
    "donation": {
      "irt": true
    }
  },
  "meta": {
    "dynamic": true
  },
  "sort": 1,
  "status": "pending",
  "is_active": true,
  "is_default": false,
  "created_at": "2026-08-01T10:00:00.000000Z"
}
event.timer.updated

TimerResource

Complete updated timer resource.

Payload exampleJSON
{
  "id": 7,
  "initial": 3600,
  "started_at": "2026-08-30T10:00:00.000000Z",
  "ends_at": "2026-08-30T11:00:00.000000Z",
  "paused_at": null,
  "finished_at": null,
  "remaining": 3600,
  "rates": {
    "donation": {
      "amount": 10000,
      "seconds": 60
    }
  },
  "status": "running",
  "is_visible": true,
  "is_decreasable": true,
  "created_at": "2026-08-01T10:00:00.000000Z"
}
event.tts.created

Temporary URL

Temporary URL for the newly created TTS audio.

Payload exampleJSON
{
  "url": "<TEMPORARY_URL>"
}
© دونوفا – تمامی حقوق برای راهکار دیجیتال نوین آریانا محفوظ است