Events

Create an event

Changed on

Create events with the provided payload. Events must be created with a page resource, which can be sideposted as shown in the example payload. Events must also have a start_at time.

post/api/v2/events

Request

  • Base URL
    https://yournation.nationbuilder.com
  • Auth
    HTTP bearer

Request body

Example request

{
  "data": {
    "type": "events",
    "attributes": {
      "additional_rsvps_count": 20,
      "attending_count": 100,
      "auto_response_broadcaster_id": "1",
      "auto_response_content": "Content of autoresponse",
      "auto_response_subject": "Subject of autoresponse",
      "capacity_count": 200,
      "contact_email": "jdoe@work.com",
      "contact_name": "John Doe",
      "contact_phone_number": "5555555555",
      "content": "Event description",
      "donation_tracking_code_id": "1",
      "duration": 3600,
      "event_form_address": "required",
      "event_form_phone": "required",
      "point_person_id": "1",
      "start_at": "2019-10-26T10:00:00-04:00",
      "time_zone": "Eastern Time (US & Canada)",
      "user_ticket_currency": "USD",
      "user_ticket_price_in_cents": 400,
      "user_ticket_purchase_url": "https://www.example.com",
      "venue_name": "Event Center",
      "venue_address_attributes": {
        "address1": "20 W 34th St.",
        "address2": "Suite 100",
        "address3": null,
        "city": "New York",
        "state": "NY",
        "zip": "10001",
        "county": "New York County",
        "country_code": "US",
        "lat": "40.7484",
        "lng": "73.9857",
        "fips": "04",
        "submitted_address": "20 W 34th St. Suite 100, New York, NY 10001",
        "distance": 0,
        "import_id": "2",
        "work_phone": "5555555555",
        "phone_number": "5555555555",
        "phone_country_code": "1",
        "work_phone_number": "5555555555",
        "delete": true
      }
    },
    "relationships": {
      "page": {
        "data": {
          "type": "pages",
          "temp-id": "new-id",
          "method": "create"
        }
      }
    }
  },
  "included": [
    {
      "type": "pages",
      "temp-id": "new-id",
      "attributes": {
        "site_id": "1",
        "parent_id": "1",
        "author_id": "1",
        "external_id": "abc",
        "slug": "your-slug",
        "status": "unlisted",
        "name": "Page Name",
        "headline": "Page headline",
        "title": "Page Title",
        "excerpt": "Page excerpt...",
        "page_type_name": "Event",
        "permission_level": "anyone"
      }
    }
  ]
}

Response

The newly created event.

metaobject

Non-standard information about the document. Empty unless the endpoint has metadata to convey.

Example response

{
  "data": {
    "id": "1",
    "type": "events",
    "attributes": {
      "additional_rsvps_count": 20,
      "attending_count": 100,
      "auto_response_broadcaster_id": "1",
      "auto_response_content": "Content of autoresponse",
      "auto_response_subject": "Subject of autoresponse",
      "capacity_count": 200,
      "contact_email": "jdoe@work.com",
      "contact_name": "John Doe",
      "contact_phone_number": "5555555555",
      "content": "Event description",
      "donation_tracking_code_id": "1",
      "duration": 3600,
      "event_form_address": "required",
      "event_form_phone": "required",
      "point_person_id": "1",
      "start_at": "2019-10-26T10:00:00-04:00",
      "time_zone": "Eastern Time (US & Canada)",
      "user_ticket_currency": "USD",
      "user_ticket_price_in_cents": 400,
      "user_ticket_purchase_url": "https://www.example.com",
      "venue_name": "Event Center",
      "page_id": "1"
    }
  },
  "included": [
    {
      "id": "1"
    }
  ]
}

Changes

    • breaking

      added subschema #2 to the request body allOf list

    • breaking

      the request's body type changed from object to no type

    • breaking

      the response's body type changed from object to no type for status

    • breaking

      removed the required property from the response with the status

    • warning

      removed the request property

    • warning

      removed the request property

    • info

      added the new optional query request parameter extra_fields[events] to all path's operations

    • info

      added the media type application/vnd.api+json to the request body

    • info

      added subschema #2 to the response body allOf list for the response status

    • info

      media type application/json was changed to a more specific media type application/vnd.api+json for the response status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • breaking

      the request property /// became not nullable

    • breaking

      the request property /// became not nullable

    • breaking

      the request property /// became not nullable

    • breaking

      the request property /// became not nullable

    • warning

      added the new America/Adak enum value to the ////// response property for the response status

    • warning

      added the new Antarctica/Troll enum value to the ////// response property for the response status

    • warning

      added the new Australia/Eucla enum value to the ////// response property for the response status

    • warning

      added the new Australia/Lord_Howe enum value to the ////// response property for the response status

    • warning

      added the new Canada/Yukon enum value to the ////// response property for the response status

    • warning

      added the new Pacific/Gambier enum value to the ////// response property for the response status

    • warning

      added the new Pacific/Kiritimati enum value to the ////// response property for the response status

    • warning

      added the new Pacific/Marquesas enum value to the ////// response property for the response status

    • warning

      added the new Pacific/Pitcairn enum value to the ////// response property for the response status

    • info

      added the new optional request property ///

    • info

      added the new optional request property ///

    • info

      added the new America/Adak enum value to the request property //////

    • info

      added the new Antarctica/Troll enum value to the request property //////

    • info

      added the new Australia/Eucla enum value to the request property //////

    • info

      added the new Australia/Lord_Howe enum value to the request property //////

    • info

      added the new Canada/Yukon enum value to the request property //////

    • info

      added the new Pacific/Gambier enum value to the request property //////

    • info

      added the new Pacific/Kiritimati enum value to the request property //////

    • info

      added the new Pacific/Marquesas enum value to the request property //////

    • info

      added the new Pacific/Pitcairn enum value to the request property //////