# Upsert a draft by owner

Endpoint: POST /api/v1/drafts
Version: 1.0
Security: header

## Query parameters:

  - `ownerId` (string, required)
    Draft owner context
    Example: "us_01hxcvk1hjexere4pvtrj0ymqq"

## Request fields (application/json):

  - `items` (array, required)

  - `items.text` (string, required)
    Post text
    Example: "Hello World"

  - `items.privacy` (string, required)
    Post privacy
    Enum: "PUBLIC", "UNLISTED", "PRIVATE", "DIRECT", "FOLLOW_POST", "HIDDEN"

  - `items.kind` (string, required)
    Note or Article
    Enum: "Note", "Article"

  - `items.attachments` (array,null)
    List with upload ids of attachments
    Example: ["us_01hxcvk1hjexere4pvtrj0ymqq"]

  - `items.poll` (object,null)
    Poll parameters

  - `items.poll.options` (array, required)
    List of poll options

  - `items.poll.expiresIn` (number, required)
    Duration in seconds
    Example: "3600"

  - `items.poll.multiple` (boolean, required)
    Allow multiple choices

  - `items.poll.hideTotals` (boolean, required)
    Hide totals until poll finishes

  - `items.commentsEnabled` (boolean)
    Enable/disable comments for the post

  - `items.sensitive` (boolean)
    Mark status and attached media as sensitive. contentWarning should be provided when this flag is true. Defaults to false.

  - `items.contentWarning` (string,null)
    Content warning. The post content and media will be hidden under the warning.

  - `items.ownerId` (string,null)
    Null if regular post. event_id for events
    Example: "us_01hxcvk1hjexere4pvtrj0ymqq"

  - `items.title` (string,null)
    Title of a post

  - `items.tags` (array,null)
    List of tags. The other way to add tags is using '#' hashtags in text

  - `items.withPreview` (boolean)
    Create Preview Card for for link in the post

  - `items.mediaType` (string,null)
    Post media type. Default for Note is text/plain, for Article text/markdown
    Enum: "TEXT_PLAIN", "MARKDOWN"

  - `items.imageUploadId` (string,null)
    Upload ID for the article image (will also be included in attachments)
    Example: "us_01hxcvk1hjexere4pvtrj0ymqq"

  - `items.postAsOwner` (boolean)
    When true, the post is attributed to the group channel specified by ownerId. Only available to channel moderators/admins. Supported for top-level posts and comments.

  - `items.quoteApprovalPolicy` (string,null)
    Quote approval policy for this post. Omit to use account default. Values: PUBLIC, FOLLOWERS, NOBODY
    Enum: "PUBLIC", "FOLLOWERS", "NOBODY"

  - `items.address` (object,null)
    Location address for the post

  - `items.address.formatted` (string, required)
    Formatted address
    Example: "Adriaen Van Ostadestraat 53, 4703 NT Roosendaal, Netherlands"

  - `items.address.name` (string,null)
    Name
    Example: "Casa Vacanze"

  - `items.address.country` (string,null)
    Country
    Example: "USA"

  - `items.address.countryCode` (string,null)
    Country two letter name
    Example: "us"

  - `items.address.region` (string,null)
    Region
    Example: "Massachusetts"

  - `items.address.regionCode` (string,null)
    Region Code
    Example: "MA"

  - `items.address.subRegion` (string,null)
    Sub-region
    Example: "Newton Heights"

  - `items.address.locality` (string,null)
    Locality
    Example: "Madrid"

  - `items.address.street` (string,null)
    Street
    Example: "Adriaen Van Ostadestraat"

  - `items.address.postalCode` (string,null)
    Address postal code
    Example: "4703 NT"

  - `items.address.houseNumber` (string,null)
    House number
    Example: "23"

  - `items.address.longitude` (number,null)
    Longitude
    Example: 4.437564

  - `items.address.latitude` (number,null)
    Latitude
    Example: 51.534581

  - `items.address.timeZone` (string,null)
    Time zone name
    Example: "Europe/Amsterdam"

  - `items.address.plusCode` (string,null)
    Short code
    Example: "9F36GCMQ+R2"

  - `items.address.serviceId` (string,null)
    Service ID
    Example: "geoapify"

  - `items.address.placeId` (string,null)
    Service place id

  - `items.removeAddress` (boolean)
    Remove existing address from the post

## Response 200 fields (application/json):

  - `id` (string, required)
    internal draft id
    Example: "us_01hxcvk1hjexere4pvtrj0ymqq"

  - `userId` (string, required)
    ID of the user who owns this draft
    Example: "us_01hxcvk1hjexere4pvtrj0ymqq"

  - `ownerId` (string, required)
    Owner context where this draft will be published
    Example: "us_01hxcvk1hjexere4pvtrj0ymqq"

  - `items` (array, required)
    Draft items (single post or chain)

  - `items.text` (string, required)
    Post text
    Example: "Hello World"

  - `items.privacy` (string, required)
    Post privacy
    Enum: "PUBLIC", "UNLISTED", "PRIVATE", "DIRECT", "FOLLOW_POST", "HIDDEN"

  - `items.kind` (string, required)
    Note or Article
    Enum: "Note", "Article"

  - `items.attachments` (array,null)
    List with upload ids of attachments
    Example: ["us_01hxcvk1hjexere4pvtrj0ymqq"]

  - `items.poll` (object,null)
    Poll parameters

  - `items.poll.options` (array, required)
    List of poll options

  - `items.poll.expiresIn` (number, required)
    Duration in seconds
    Example: "3600"

  - `items.poll.multiple` (boolean, required)
    Allow multiple choices

  - `items.poll.hideTotals` (boolean, required)
    Hide totals until poll finishes

  - `items.commentsEnabled` (boolean)
    Enable/disable comments for the post

  - `items.sensitive` (boolean)
    Mark status and attached media as sensitive. contentWarning should be provided when this flag is true. Defaults to false.

  - `items.contentWarning` (string,null)
    Content warning. The post content and media will be hidden under the warning.

  - `items.ownerId` (string,null)
    Null if regular post. event_id for events
    Example: "us_01hxcvk1hjexere4pvtrj0ymqq"

  - `items.title` (string,null)
    Title of a post

  - `items.tags` (array,null)
    List of tags. The other way to add tags is using '#' hashtags in text

  - `items.withPreview` (boolean)
    Create Preview Card for for link in the post

  - `items.mediaType` (string,null)
    Post media type. Default for Note is text/plain, for Article text/markdown
    Enum: "TEXT_PLAIN", "MARKDOWN"

  - `items.imageUploadId` (string,null)
    Upload ID for the article image (will also be included in attachments)
    Example: "us_01hxcvk1hjexere4pvtrj0ymqq"

  - `items.postAsOwner` (boolean)
    When true, the post is attributed to the group channel specified by ownerId. Only available to channel moderators/admins. Supported for top-level posts and comments.

  - `items.quoteApprovalPolicy` (string,null)
    Quote approval policy for this post. Omit to use account default. Values: PUBLIC, FOLLOWERS, NOBODY
    Enum: "PUBLIC", "FOLLOWERS", "NOBODY"

  - `items.address` (object,null)
    Location address for the post

  - `items.address.formatted` (string, required)
    Formatted address
    Example: "Adriaen Van Ostadestraat 53, 4703 NT Roosendaal, Netherlands"

  - `items.address.name` (string,null)
    Name
    Example: "Casa Vacanze"

  - `items.address.country` (string,null)
    Country
    Example: "USA"

  - `items.address.countryCode` (string,null)
    Country two letter name
    Example: "us"

  - `items.address.region` (string,null)
    Region
    Example: "Massachusetts"

  - `items.address.regionCode` (string,null)
    Region Code
    Example: "MA"

  - `items.address.subRegion` (string,null)
    Sub-region
    Example: "Newton Heights"

  - `items.address.locality` (string,null)
    Locality
    Example: "Madrid"

  - `items.address.street` (string,null)
    Street
    Example: "Adriaen Van Ostadestraat"

  - `items.address.postalCode` (string,null)
    Address postal code
    Example: "4703 NT"

  - `items.address.houseNumber` (string,null)
    House number
    Example: "23"

  - `items.address.longitude` (number,null)
    Longitude
    Example: 4.437564

  - `items.address.latitude` (number,null)
    Latitude
    Example: 51.534581

  - `items.address.timeZone` (string,null)
    Time zone name
    Example: "Europe/Amsterdam"

  - `items.address.plusCode` (string,null)
    Short code
    Example: "9F36GCMQ+R2"

  - `items.address.serviceId` (string,null)
    Service ID
    Example: "geoapify"

  - `items.address.placeId` (string,null)
    Service place id

  - `items.removeAddress` (boolean)
    Remove existing address from the post

  - `createdAt` (string, required)
    When the draft was created
    Example: "2022-03-10T16:15:50Z"

  - `updatedAt` (string, required)
    When the draft was last updated
    Example: "2022-03-10T16:15:50Z"

## Response 401 fields (application/json):

  - `errorCode` (string, required)
    Error code

  - `message` (string, required)
    Error message

  - `docUrl` (string)
    Link to documentation


## Response 400 fields
