Skip to content
Developers

Quests: credits and objectives

Create and schedule quests through the API, including quest credits, objectives and the rules for quests that have started.

Use these fields to publish quests with objectives from another system or an AI agent. Every quest you create spends one quest credit of the owning account, and the credit's plan sets the longest the quest can run. Quests use the shared operations in Events, courses, content, quests and jobs: list, get, update and archive on /api/v1/quests, with the same scopes, owner selector, visibility rules, Idempotency-Key header and limits (30 quest creates per day, 128 KiB per request). To enroll participants and review evidence, see Participation workflows.

The examples read the key from HIVE_API_KEY. Some field names still say community or person; both identify accounts.

#Quest fields

FieldTypeNotes
titlestringRequired.
descriptionstringQuest text.
questCreditPlanstringRequired on create: single (7-day credit, quests up to 7 days) or bundle (30-day credit, quests up to 30 days). Fixed after creation.
startsAtstringRequired on create. ISO 8601 with Z or an offset.
endsAtstringOptional end. Without it the quest runs 30 days from startsAt.
objectivesarrayWhat participants do. tasks is accepted as an alias. See Objectives.
autoEnrollbooleanDefault true: participants join without approval.
credentialsstring arrayIDs of credentials linked to the quest (credentialIds also works).
statusstringDefault active. Whether a quest is scheduled, active or ended follows startsAt and endsAt.
visibility, subscriptionId, badgesAs in Shared behavior.

The server owns maxQuestDays, questCreditSource and questCreditId; values you send for them are ignored. Responses show them in data together with questCreditPlan.

#Objectives

Objectives are stored as you send them. Each is an object:

FieldTypeNotes
idstringStable ID used when participants submit evidence. Defaults to the quest ID plus the position.
typestringpost_likes_given, post_comments_created, courses_completed, course_progress, metaverse_events_attended, virtual_events_attended, jobs_applied or custom. Progress for the first seven is counted by Hive3; custom objectives are completed with evidence, and unknown types never advance.
name, shortDescriptionstringLabels shown to participants.
targetCountintegerHow many times; default 1.
evidenceTypestringFor custom: written, link or document.
targetEventId, targetCourseId, targetJobIdstringLimit an objective to one resource.

#Quest credits

  • Creating a quest spends one credit of the owning account (the community when you use the owner selector). The credit's length matches questCreditPlan.
  • The account's monthly allowance is spent first: Swarm includes one 7-day and one 30-day credit per UTC calendar month, Royal Hive two of each. Unused monthly credits expire at month end. Credits bought in the app are spent after that. Worker Bee and Honey Bee accounts have no monthly allowance.
  • With no credit left the request returns 403 forbidden (No 7-day quest credits left. Buy a quest credit to create this quest., or 30-day for bundle). A request that fails validation spends no credit.
  • Archiving a quest does not refund its credit.
  • questCreditPlan is read without regard to case. A missing value returns 400 (questCreditPlan is required: single (7-day) or bundle (30-day)) and an unknown one returns 400 (Quest credit plan not found: weekly).

#Schedule and duration

A credited quest needs a valid startsAt (Credited quests require a valid startsAt timestamp), and a supplied endsAt must be valid too (Quest endsAt must be a valid timestamp). The span from startsAt to endsAt cannot exceed the plan: 7 days for single and 30 days for bundle, with one hour of tolerance for daylight-saving changes (Quest duration cannot exceed 7 days for its quest credit plan). Because an omitted endsAt means 30 days, a single quest always needs an explicit endsAt within 7 days.

On PATCH, an omitted startsAt keeps the stored start; sending startsAt, including null, replaces it. The stored plan and maxQuestDays stay in force.

#Quests that have started

A quest is locked once its start time has passed or it has ended. A locked quest returns 409 conflict on PATCH (This quest has started and can no longer be edited.) and on DELETE (This quest has started and can no longer be cancelled.). A quest created with a startsAt in the past is therefore locked from the first request. Quests whose startsAt is not a valid timestamp stay editable and cancellable. Archiving a quest that is already archived returns 200 again, like every other kind.

#Create a quest

POST/api/v1/questsScoperesources:writecommunities:write (community owner)

Creates a quest, spends one quest credit and returns the quest. The example is a 7-day quest with two objectives.

bash
curl -X POST https://app.hive3.tech/api/v1/quests \
  -H "Authorization: Bearer $HIVE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: first-post-quest-001" \
  -d '{"title":"Share Your First Post","description":"Post and comment in the feed.","questCreditPlan":"single","startsAt":"2030-03-01T00:00:00Z","endsAt":"2030-03-07T23:59:59Z","objectives":[{"id":"comments","type":"post_comments_created","name":"Comment on two posts","targetCount":2},{"id":"likes","type":"post_likes_given","name":"Like three posts","targetCount":3}]}'

Returns 201. data holds the accepted body plus the server-set credit fields; questCreditSource is monthly or purchased.

json
{
  "data": {
    "id": "quest_123",
    "type": "quest",
    "title": "Share Your First Post",
    "description": "Post and comment in the feed.",
    "status": "active",
    "visibility": "public",
    "autoEnroll": true,
    "badges": [],
    "credentials": [],
    "objectives": [
      { "id": "comments", "type": "post_comments_created", "name": "Comment on two posts", "targetCount": 2 },
      { "id": "likes", "type": "post_likes_given", "name": "Like three posts", "targetCount": 3 }
    ],
    "owner": { "type": "person", "personId": "account_123" },
    "data": {
      "title": "Share Your First Post",
      "description": "Post and comment in the feed.",
      "startsAt": "2030-03-01T00:00:00Z",
      "endsAt": "2030-03-07T23:59:59Z",
      "autoEnroll": true,
      "visibility": "public",
      "questCreditPlan": "single",
      "maxQuestDays": 7,
      "questCreditSource": "monthly"
    },
    "createdAt": 1767225600000,
    "updatedAt": 1767225600000
  }
}
StatuscodeWhen
400invalid_requestTitle is required, a missing or unknown questCreditPlan, a missing or invalid startsAt or endsAt, or a duration over the plan limit.
403forbiddenNo credit of that length left, the Worker Bee visibility or subscription rule, or a managed account outside the key's allowlist.
409conflictThe Idempotency-Key was used with a different request.

#Update a quest

PATCH/api/v1/quests/{id}Scoperesources:writecommunities:write (community-owned)

Partially updates a quest that has not started. The plan and its day limit stay as created, so a longer endsAt than the plan allows returns 400.

bash
curl -X PATCH https://app.hive3.tech/api/v1/quests/quest_123 \
  -H "Authorization: Bearer $HIVE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"description":"Post, comment and like in the feed.","endsAt":"2030-03-06T23:59:59Z"}'

Returns 200 with the updated quest. Errors: 400 (schedule or duration rules above), 404 not_found (unknown or archived), 409 conflict (the quest has started or ended).