v1

latestOpenAPI 3.1.02026-07-243113441.2 MB
Employee Forms

Generate a W2 form [DEMO]

🚧 Demo action

This action is only available in the Demo environment

Generates a W2 document for testing purposes.

scope: employees:write

post/v1/sandbox/generate_w2

Headers

X-Gusto-API-Version'2026-06-15'

Determines the date-based API version associated with your API call. If none is provided, your application's minimum API version is used.

Request body

employee_idstring required

The employee UUID.

yearinteger

Must be equal to or more recent than 2015. If not specified, defaults to the previous year.

Response

Created

uuidstring required

The UUID of the form

employee_uuidstring

The UUID of the employee to which the form belongs, if applicable.

namestring

The type identifier of the form

titlestring

The title of the form

descriptionstring

The description of the form

draftboolean

If the form is in a draft state. E.g. End of year tax forms may be provided in a draft state prior to being finalized.

yearinteger nullable

The year of this form. For some forms, e.g. tax forms, this is the year which the form represents. A W2 for January - December 2022 would be delivered in January 2023 and have a year value of 2022. This value is nullable and will not be present on all forms.

quarterinteger nullable

The quarter of this form. For some forms, e.g. tax forms, this is the calendar quarter which this form represents. An Employer's Quarterly Federal Tax Return (Form 941) for April, May, June 2022 would have a quarter value of 2 (and a year value of 2022). This value is nullable and will not be present on all forms.

requires_signingboolean

A boolean flag that indicates whether the form needs signing or not. Note that this value will change after the form is signed.

document_content_typestring nullable

The content type of the associated document. Most forms are PDFs with a content type of application/pdf. Some tax file packages will be zip files (containing PDFs) with a content type of application/zip. This attribute will be null when the document has not been prepared.