Requester API

The Mechanical Turk API, on a crowd someone answers for.

The A2Z Requester API speaks the Mechanical Turk 2017-01-17 protocol: the same 38 working operations, the same JSON, the same AWS request signing. Point your existing client at A2Z, keep your code, and your HITs are worked by partner-verified people.

Change one line

Create an API key in the requester console, then set the endpoint. Requests are signed with AWS Signature Version 4, so boto3, the AWS CLI and the AWS SDKs work without changes. Use any region, the service name is mturk-requester.

import boto3

mturk = boto3.client(
    "mturk",
    region_name="us-east-1",
    endpoint_url="https://platform.a2zboard.com/mturk",
    aws_access_key_id="A2ZK...",
    aws_secret_access_key="...",
)

hit = mturk.create_hit(
    Title="Verify an invoice total",
    Description="Compare the draft with the image",
    Reward="0.12",
    MaxAssignments=2,
    LifetimeInSeconds=86400,
    AssignmentDurationInSeconds=600,
    Question=open("question.xml").read(),
)["HIT"]

Or with the AWS CLI

aws mturk get-account-balance \
  --endpoint-url https://platform.a2zboard.com/mturk \
  --region us-east-1

curl https://platform.a2zboard.com/mturk \
  --aws-sigv4 "aws:amz:us-east-1:mturk-requester" \
  --user "$A2Z_KEY_ID:$A2Z_SECRET" \
  -H "Content-Type: application/x-amz-json-1.1" \
  -H "X-Amz-Target: MTurkRequesterServiceV20170117.GetAccountBalance" \
  -d '{}'

Sandbox keys are free and always show a balance of 10,000.00. Nobody is paid in the sandbox, and workers see sandbox HITs only when they switch on sandbox mode.

Wire protocol

EndpointPOST https://platform.a2zboard.com/mturk
HeadersContent-Type: application/x-amz-json-1.1 and X-Amz-Target: MTurkRequesterServiceV20170117.<Operation>
AuthenticationAWS Signature Version 4 with an A2Z access key. Requests older than 15 minutes are refused.
TimestampsEpoch seconds as JSON numbers, like the original API.
MoneyUS dollar strings such as "0.10". Rewards from $0.01.
ErrorsHTTP 400 with __type RequestError, or 500 with ServiceFault. Both carry Message and TurkErrorCode, for example AWS.MechanicalTurk.HitAlreadyExists.
PagingNextToken and MaxResults on every list operation, up to 100 per page.
IdempotencyUniqueRequestToken on CreateHIT, CreateHITWithHITType, CreateAdditionalAssignmentsForHIT and SendBonus, honoured for 24 hours.

Operations

Every operation of the 2017-01-17 API is implemented except the deprecated GetFileUploadURL.

AreaOperations
HIT types and HITsCreateHITType CreateHIT CreateHITWithHITType GetHIT ListHITs ListReviewableHITs ListHITsForQualificationType UpdateExpirationForHIT UpdateHITReviewStatus UpdateHITTypeOfHIT CreateAdditionalAssignmentsForHIT DeleteHIT
Assignments and reviewListAssignmentsForHIT GetAssignment ApproveAssignment (with OverrideRejection) RejectAssignment ListReviewPolicyResultsForHIT
Bonuses and messagesSendBonus ListBonusPayments NotifyWorkers
WorkersCreateWorkerBlock DeleteWorkerBlock ListWorkerBlocks
QualificationsCreateQualificationType UpdateQualificationType DeleteQualificationType GetQualificationType ListQualificationTypes ListQualificationRequests AcceptQualificationRequest RejectQualificationRequest AssociateQualificationWithWorker DisassociateQualificationFromWorker GetQualificationScore ListWorkersWithQualificationType
NotificationsUpdateNotificationSettings SendTestEventNotification
AccountGetAccountBalance

HITStatus values, assignment states, qualification comparators (LessThan through NotIn), ActionsGuarded, review policies (ScoreMyKnownAnswers and SimplePlurality) and answer keys behave as documented for Mechanical Turk.

Question formats

HITs are shown to workers in a sandboxed frame and submit their answers to A2Z. The answer you read back is the standard QuestionFormAnswers XML.

  • HTMLQuestion: your HTML, hosted by A2Z. Forms that post to the Mechanical Turk submit address are rewritten automatically, and externalHIT_v1.js is served for you.
  • ExternalQuestion: your HTTPS page in a frame with assignmentId, hitId, workerId and turkSubmitTo. Post your form to turkSubmitTo + "/mturk/externalSubmit".
  • QuestionForm: rendered from your XML with required fields, numeric and length limits, regular expressions and selection counts checked before submit.
  • HITLayout: store a layout with ${variables} in the console and pass HITLayoutId with HITLayoutParameters.

Qualifications

The built-in qualification types are computed from each worker's record: Worker_Locale, Worker_NumberHITsApproved, Worker_PercentAssignmentsApproved, Worker_Adult and Masters. Custom types support requests, manual grants, automatic grants and graded tests with an AnswerKey.

Regions you pick in the console, such as the EU, become a Worker_Locale requirement on your HIT type, so work only reaches workers registered in those countries.

Notifications

Attach a notification to a HIT type with UpdateNotificationSettings. Events are batched, delivered at least once, retried with backoff and carry the standard document (Version 2014-08-15, EventDocId, Events).

  • SQS: a queue URL. Allow the A2Z notifier to send with a queue policy.
  • SNS: a topic ARN, with the same kind of policy.
  • Email: an address.
  • Webhook: an HTTPS URL. Each call is signed: X-A2Z-Signature carries a timestamp and an HMAC-SHA256 of the body with your workspace secret.

Event types: AssignmentAccepted, AssignmentAbandoned, AssignmentReturned, AssignmentSubmitted, AssignmentApproved, AssignmentRejected, HITCreated, HITExtended, HITReviewable, HITExpired, HITDisposed and Ping.

Money

Creating a HIT holds the reward plus the platform fee for every assignment. Approval spends the hold, rejection releases it, and unused assignments come back when the HIT expires. The fee is a single percentage of the reward, rounded to the cent, with a one cent minimum. There is no surcharge for large assignment counts.

Rewards are paid to workers by their partner organisation. A2Z settles with the partner, so you never handle payments to individuals.

What is different from Mechanical Turk

TopicA2Z
WorkersEvery worker is registered through a partner organisation that verifies them, manages them and pays them. Worker IDs look the same and stay stable.
EndpointsOne endpoint. Your key decides whether you are in the sandbox or live.
Masters and premium qualificationsMasters is granted by A2Z. The paid demographic premium qualifications are not offered.
Crowd HTML ElementsNot bundled. HTML that includes its own copy of a library keeps working.
File uploadsFileUploadAnswer and GetFileUploadURL are not supported. Use an ExternalQuestion for uploads.
SQS and SNSMessages are sent from A2Z's AWS principal to your queue or topic once your resource policy allows it.
RetentionHITs and assignments are disposed 120 days after creation, as on Mechanical Turk.

Credit where it is due

Mechanical Turk created this standard: the HIT, the assignment, the qualification and the API around them. Twenty years of research on crowdsourcing and human-in-the-loop AI were built on it. A2Z implements a compatible API so that existing code and templates keep working.

A2Z is not affiliated with or endorsed by Amazon. Amazon Mechanical Turk and MTurk are trademarks of Amazon.com, Inc. or its affiliates.