hits
Creates, updates, deletes, gets or lists a hits resource.
Overview
| Name | hits |
| Type | Resource |
| Id | aws.mturk.hits |
Fields
The following fields are returned by SELECT queries:
- get_hit
| Name | Datatype | Description |
|---|---|---|
assignment_duration_in_seconds | integer (int64) | The length of time, in seconds, that a Worker has to complete the HIT after accepting it. |
auto_approval_delay_in_seconds | integer (int64) | The amount of time, in seconds, after the Worker submits an assignment for the HIT that the results are automatically approved by Amazon Mechanical Turk. This is the amount of time the Requester has to reject an assignment submitted by a Worker before the assignment is auto-approved and the Worker is paid. |
creation_time | string (date-time) | The date and time the HIT was created. |
description | string | A general description of the HIT. |
expiration | string (date-time) | The date and time the HIT expires. |
hit_group_id | string | The ID of the HIT Group of this HIT. (pattern: <code>^[A-Z0-9]+$</code>) |
hit_id | string | A unique identifier for the HIT. (pattern: <code>^[A-Z0-9]+$</code>) |
hit_layout_id | string | The ID of the HIT Layout of this HIT. (pattern: <code>^[A-Z0-9]+$</code>) |
hit_review_status | string | Indicates the review status of the HIT. Valid Values are NotReviewed | MarkedForReview | ReviewedAppropriate | ReviewedInappropriate. (NotReviewed, MarkedForReview, ReviewedAppropriate, ReviewedInappropriate) |
hit_status | string | The status of the HIT and its assignments. Valid Values are Assignable | Unassignable | Reviewable | Reviewing | Disposed. (Assignable, Unassignable, Reviewable, Reviewing, Disposed) |
hit_type_id | string | The ID of the HIT type of this HIT (pattern: <code>^[A-Z0-9]+$</code>) |
keywords | string | One or more words or phrases that describe the HIT, separated by commas. Search terms similar to the keywords of a HIT are more likely to have the HIT in the search results. |
max_assignments | integer | The number of times the HIT can be accepted and completed before the HIT becomes unavailable. |
number_of_assignments_available | integer | The number of assignments for this HIT that are available for Workers to accept. |
number_of_assignments_completed | integer | The number of assignments for this HIT that have been approved or rejected. |
number_of_assignments_pending | integer | The number of assignments for this HIT that are being previewed or have been accepted by Workers, but have not yet been submitted, returned, or abandoned. |
qualification_requirements | array | Conditions that a Worker's Qualifications must meet in order to accept the HIT. A HIT can have between zero and ten Qualification requirements. All requirements must be met in order for a Worker to accept the HIT. Additionally, other actions can be restricted using the ActionsGuarded field on each QualificationRequirement structure. |
question | string | The data the Worker completing the HIT uses produce the results. This is either either a QuestionForm, HTMLQuestion or an ExternalQuestion data structure. |
requester_annotation | string | An arbitrary data field the Requester who created the HIT can use. This field is visible only to the creator of the HIT. |
reward | string | A string representing a currency amount. (pattern: <code>^[0-9]+(.)?[0-9]{0,2}$</code>) |
title | string | The title of the HIT. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_hit | select | region | The GetHIT operation retrieves the details of the specified HIT. | |
create_hit | insert | region, LifetimeInSeconds, AssignmentDurationInSeconds, Reward, Title, Description | The CreateHIT operation creates a new Human Intelligence Task (HIT). The new HIT is made available for Workers to find and accept on the Amazon Mechanical Turk website. This operation allows you to specify a new HIT by passing in values for the properties of the HIT, such as its title, reward amount and number of assignments. When you pass these values to CreateHIT, a new HIT is created for you, with a new HITTypeID. The HITTypeID can be used to create additional HITs in the future without needing to specify common parameters such as the title, description and reward amount each time. An alternative way to create HITs is to first generate a HITTypeID using the CreateHITType operation and then call the CreateHITWithHITType operation. This is the recommended best practice for Requesters who are creating large numbers of HITs. CreateHIT also supports several ways to provide question data: by providing a value for the Question parameter that fully specifies the contents of the HIT, or by providing a HitLayoutId and associated HitLayoutParameters. If a HIT is created with 10 or more maximum assignments, there is an additional fee. For more information, see Amazon Mechanical Turk Pricing. | |
create_hit_type | insert | region, AssignmentDurationInSeconds, Reward, Title, Description | The CreateHITType operation creates a new HIT type. This operation allows you to define a standard set of HIT properties to use when creating HITs. If you register a HIT type with values that match an existing HIT type, the HIT type ID of the existing type will be returned. | |
create_hit_with_hit_type | insert | region, HITTypeId, LifetimeInSeconds | The CreateHITWithHITType operation creates a new Human Intelligence Task (HIT) using an existing HITTypeID generated by the CreateHITType operation. This is an alternative way to create HITs from the CreateHIT operation. This is the recommended best practice for Requesters who are creating large numbers of HITs. CreateHITWithHITType also supports several ways to provide question data: by providing a value for the Question parameter that fully specifies the contents of the HIT, or by providing a HitLayoutId and associated HitLayoutParameters. If a HIT is created with 10 or more maximum assignments, there is an additional fee. For more information, see Amazon Mechanical Turk Pricing. | |
update_expiration_for_hit | update | region, HITId, ExpireAt | The UpdateExpirationForHIT operation allows you update the expiration time of a HIT. If you update it to a time in the past, the HIT will be immediately expired. | |
update_hit_type_of_hit | update | region, HITId, HITTypeId | The UpdateHITTypeOfHIT operation allows you to change the HITType properties of a HIT. This operation disassociates the HIT from its old HITType properties and associates it with the new HITType properties. The HIT takes on the properties of the new HITType in place of the old ones. | |
update_hit_review_status | update | region, HITId | The UpdateHITReviewStatus operation updates the status of a HIT. If the status is Reviewable, this operation can update the status to Reviewing, or it can revert a Reviewing HIT back to the Reviewable status. | |
delete_hit | delete | region | The DeleteHIT operation is used to delete HIT that is no longer needed. Only the Requester who created the HIT can delete it. You can only dispose of HITs that are in the Reviewable state, with all of their submitted assignments already either approved or rejected. If you call the DeleteHIT operation on a HIT that is not in the Reviewable state (for example, that has not expired, or still has active assignments), or on a HIT that is Reviewable but without all of its submitted assignments already approved or rejected, the service will return an error. HITs are automatically disposed of after 120 days. After you dispose of a HIT, you can no longer approve the HIT's rejected assignments. Disposed HITs are not returned in results for the ListHITs operation. Disposing HITs can improve the performance of operations such as ListReviewableHITs and ListHITs. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_hit
The GetHIT operation retrieves the details of the specified HIT.
SELECT
assignment_duration_in_seconds,
auto_approval_delay_in_seconds,
creation_time,
description,
expiration,
hit_group_id,
hit_id,
hit_layout_id,
hit_review_status,
hit_status,
hit_type_id,
keywords,
max_assignments,
number_of_assignments_available,
number_of_assignments_completed,
number_of_assignments_pending,
qualification_requirements,
question,
requester_annotation,
reward,
title
FROM aws.mturk.hits
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_hit
- create_hit_type
- create_hit_with_hit_type
- Manifest
The CreateHIT operation creates a new Human Intelligence Task (HIT). The new HIT is made available for Workers to find and accept on the Amazon Mechanical Turk website. This operation allows you to specify a new HIT by passing in values for the properties of the HIT, such as its title, reward amount and number of assignments. When you pass these values to CreateHIT, a new HIT is created for you, with a new HITTypeID. The HITTypeID can be used to create additional HITs in the future without needing to specify common parameters such as the title, description and reward amount each time. An alternative way to create HITs is to first generate a HITTypeID using the CreateHITType operation and then call the CreateHITWithHITType operation. This is the recommended best practice for Requesters who are creating large numbers of HITs. CreateHIT also supports several ways to provide question data: by providing a value for the Question parameter that fully specifies the contents of the HIT, or by providing a HitLayoutId and associated HitLayoutParameters. If a HIT is created with 10 or more maximum assignments, there is an additional fee. For more information, see Amazon Mechanical Turk Pricing.
INSERT INTO aws.mturk.hits (
MaxAssignments,
AutoApprovalDelayInSeconds,
LifetimeInSeconds,
AssignmentDurationInSeconds,
Reward,
Title,
Keywords,
Description,
Question,
RequesterAnnotation,
QualificationRequirements,
UniqueRequestToken,
AssignmentReviewPolicy,
HITReviewPolicy,
HITLayoutId,
HITLayoutParameters,
region
)
SELECT
{{ MaxAssignments }},
{{ AutoApprovalDelayInSeconds }},
{{ LifetimeInSeconds }} /* required */,
{{ AssignmentDurationInSeconds }} /* required */,
'{{ Reward }}' /* required */,
'{{ Title }}' /* required */,
'{{ Keywords }}',
'{{ Description }}' /* required */,
'{{ Question }}',
'{{ RequesterAnnotation }}',
'{{ QualificationRequirements }}',
'{{ UniqueRequestToken }}',
'{{ AssignmentReviewPolicy }}',
'{{ HITReviewPolicy }}',
'{{ HITLayoutId }}',
'{{ HITLayoutParameters }}',
'{{ region }}'
RETURNING
hit
;
The CreateHITType operation creates a new HIT type. This operation allows you to define a standard set of HIT properties to use when creating HITs. If you register a HIT type with values that match an existing HIT type, the HIT type ID of the existing type will be returned.
INSERT INTO aws.mturk.hits (
AutoApprovalDelayInSeconds,
AssignmentDurationInSeconds,
Reward,
Title,
Keywords,
Description,
QualificationRequirements,
region
)
SELECT
{{ AutoApprovalDelayInSeconds }},
{{ AssignmentDurationInSeconds }} /* required */,
'{{ Reward }}' /* required */,
'{{ Title }}' /* required */,
'{{ Keywords }}',
'{{ Description }}' /* required */,
'{{ QualificationRequirements }}',
'{{ region }}'
RETURNING
hit_type_id
;
The CreateHITWithHITType operation creates a new Human Intelligence Task (HIT) using an existing HITTypeID generated by the CreateHITType operation. This is an alternative way to create HITs from the CreateHIT operation. This is the recommended best practice for Requesters who are creating large numbers of HITs. CreateHITWithHITType also supports several ways to provide question data: by providing a value for the Question parameter that fully specifies the contents of the HIT, or by providing a HitLayoutId and associated HitLayoutParameters. If a HIT is created with 10 or more maximum assignments, there is an additional fee. For more information, see Amazon Mechanical Turk Pricing.
INSERT INTO aws.mturk.hits (
HITTypeId,
MaxAssignments,
LifetimeInSeconds,
Question,
RequesterAnnotation,
UniqueRequestToken,
AssignmentReviewPolicy,
HITReviewPolicy,
HITLayoutId,
HITLayoutParameters,
region
)
SELECT
'{{ HITTypeId }}' /* required */,
{{ MaxAssignments }},
{{ LifetimeInSeconds }} /* required */,
'{{ Question }}',
'{{ RequesterAnnotation }}',
'{{ UniqueRequestToken }}',
'{{ AssignmentReviewPolicy }}',
'{{ HITReviewPolicy }}',
'{{ HITLayoutId }}',
'{{ HITLayoutParameters }}',
'{{ region }}'
RETURNING
hit
;
# Description fields are for documentation purposes
- name: hits
props:
- name: region
value: "{{ region }}"
description: Required parameter for the hits resource.
- name: MaxAssignments
value: {{ MaxAssignments }}
description: |
The number of times the HIT can be accepted and completed before the HIT becomes unavailable.
- name: AutoApprovalDelayInSeconds
value: {{ AutoApprovalDelayInSeconds }}
description: |
The number of seconds after an assignment for the HIT has been submitted, after which the assignment is considered Approved automatically unless the Requester explicitly rejects it.
- name: LifetimeInSeconds
value: {{ LifetimeInSeconds }}
description: |
An amount of time, in seconds, after which the HIT is no longer available for users to accept. After the lifetime of the HIT elapses, the HIT no longer appears in HIT searches, even if not all of the assignments for the HIT have been accepted.
- name: AssignmentDurationInSeconds
value: {{ AssignmentDurationInSeconds }}
description: |
The amount of time, in seconds, that a Worker has to complete the HIT after accepting it. If a Worker does not complete the assignment within the specified duration, the assignment is considered abandoned. If the HIT is still active (that is, its lifetime has not elapsed), the assignment becomes available for other users to find and accept.
- name: Reward
value: "{{ Reward }}"
description: |
A string representing a currency amount.
- name: Title
value: "{{ Title }}"
description: |
The title of the HIT. A title should be short and descriptive about the kind of task the HIT contains. On the Amazon Mechanical Turk web site, the HIT title appears in search results, and everywhere the HIT is mentioned.
- name: Keywords
value: "{{ Keywords }}"
description: |
One or more words or phrases that describe the HIT, separated by commas. These words are used in searches to find HITs.
- name: Description
value: "{{ Description }}"
description: |
A general description of the HIT. A description includes detailed information about the kind of task the HIT contains. On the Amazon Mechanical Turk web site, the HIT description appears in the expanded view of search results, and in the HIT and assignment screens. A good description gives the user enough information to evaluate the HIT before accepting it.
- name: Question
value: "{{ Question }}"
description: |
The data the person completing the HIT uses to produce the results. Constraints: Must be a QuestionForm data structure, an ExternalQuestion data structure, or an HTMLQuestion data structure. The XML question data must not be larger than 64 kilobytes (65,535 bytes) in size, including whitespace. Either a Question parameter or a HITLayoutId parameter must be provided.
- name: RequesterAnnotation
value: "{{ RequesterAnnotation }}"
description: |
An arbitrary data field. The RequesterAnnotation parameter lets your application attach arbitrary data to the HIT for tracking purposes. For example, this parameter could be an identifier internal to the Requester's application that corresponds with the HIT. The RequesterAnnotation parameter for a HIT is only visible to the Requester who created the HIT. It is not shown to the Worker, or any other Requester. The RequesterAnnotation parameter may be different for each HIT you submit. It does not affect how your HITs are grouped.
- name: QualificationRequirements
description: |
Conditions that a Worker's Qualifications must meet in order to accept the HIT. A HIT can have between zero and ten Qualification requirements. All requirements must be met in order for a Worker to accept the HIT. Additionally, other actions can be restricted using the ActionsGuarded field on each QualificationRequirement structure.
value:
- QualificationTypeId: "{{ QualificationTypeId }}"
Comparator: "{{ Comparator }}"
IntegerValues: "{{ IntegerValues }}"
LocaleValues: "{{ LocaleValues }}"
RequiredToPreview: {{ RequiredToPreview }}
ActionsGuarded: "{{ ActionsGuarded }}"
- name: UniqueRequestToken
value: "{{ UniqueRequestToken }}"
description: |
A unique identifier for this request which allows you to retry the call on error without creating duplicate HITs. This is useful in cases such as network timeouts where it is unclear whether or not the call succeeded on the server. If the HIT already exists in the system from a previous call using the same UniqueRequestToken, subsequent calls will return a AWS.MechanicalTurk.HitAlreadyExists error with a message containing the HITId. Note: It is your responsibility to ensure uniqueness of the token. The unique token expires after 24 hours. Subsequent calls using the same UniqueRequestToken made after the 24 hour limit could create duplicate HITs.
- name: AssignmentReviewPolicy
description: |
The Assignment-level Review Policy applies to the assignments under the HIT. You can specify for Mechanical Turk to take various actions based on the policy.
value:
PolicyName: "{{ PolicyName }}"
Parameters:
- Key: "{{ Key }}"
Values: "{{ Values }}"
MapEntries: "{{ MapEntries }}"
- name: HITReviewPolicy
description: |
The HIT-level Review Policy applies to the HIT. You can specify for Mechanical Turk to take various actions based on the policy.
value:
PolicyName: "{{ PolicyName }}"
Parameters:
- Key: "{{ Key }}"
Values: "{{ Values }}"
MapEntries: "{{ MapEntries }}"
- name: HITLayoutId
value: "{{ HITLayoutId }}"
description: |
The HITLayoutId allows you to use a pre-existing HIT design with placeholder values and create an additional HIT by providing those values as HITLayoutParameters. Constraints: Either a Question parameter or a HITLayoutId parameter must be provided.
- name: HITLayoutParameters
description: |
If the HITLayoutId is provided, any placeholder values must be filled in with values using the HITLayoutParameter structure. For more information, see HITLayout.
value:
- Name: "{{ Name }}"
Value: "{{ Value }}"
- name: HITTypeId
value: "{{ HITTypeId }}"
description: |
The HIT type ID you want to create this HIT with.
UPDATE examples
- update_expiration_for_hit
- update_hit_type_of_hit
- update_hit_review_status
The UpdateExpirationForHIT operation allows you update the expiration time of a HIT. If you update it to a time in the past, the HIT will be immediately expired.
UPDATE aws.mturk.hits
SET
HITId = '{{ HITId }}',
ExpireAt = '{{ ExpireAt }}'
WHERE
region = '{{ region }}' --required
AND HITId = '{{ HITId }}' --required
AND ExpireAt = '{{ ExpireAt }}' --required;
The UpdateHITTypeOfHIT operation allows you to change the HITType properties of a HIT. This operation disassociates the HIT from its old HITType properties and associates it with the new HITType properties. The HIT takes on the properties of the new HITType in place of the old ones.
UPDATE aws.mturk.hits
SET
HITId = '{{ HITId }}',
HITTypeId = '{{ HITTypeId }}'
WHERE
region = '{{ region }}' --required
AND HITId = '{{ HITId }}' --required
AND HITTypeId = '{{ HITTypeId }}' --required;
The UpdateHITReviewStatus operation updates the status of a HIT. If the status is Reviewable, this operation can update the status to Reviewing, or it can revert a Reviewing HIT back to the Reviewable status.
UPDATE aws.mturk.hits
SET
HITId = '{{ HITId }}',
Revert = {{ Revert }}
WHERE
region = '{{ region }}' --required
AND HITId = '{{ HITId }}' --required;
DELETE examples
- delete_hit
The DeleteHIT operation is used to delete HIT that is no longer needed. Only the Requester who created the HIT can delete it. You can only dispose of HITs that are in the Reviewable state, with all of their submitted assignments already either approved or rejected. If you call the DeleteHIT operation on a HIT that is not in the Reviewable state (for example, that has not expired, or still has active assignments), or on a HIT that is Reviewable but without all of its submitted assignments already approved or rejected, the service will return an error. HITs are automatically disposed of after 120 days. After you dispose of a HIT, you can no longer approve the HIT's rejected assignments. Disposed HITs are not returned in results for the ListHITs operation. Disposing HITs can improve the performance of operations such as ListReviewableHITs and ListHITs.
DELETE FROM aws.mturk.hits
WHERE region = '{{ region }}' --required
;