Skip to main content
Contributor I
September 9, 2026
Solved

Spec says non-nullable, live API returns null - links.next and organization_name

  • September 9, 2026
  • 1 reply
  • 53 views

We're building an integration pinned to revision 2026-07-15, and our tests validate our client against the OpenAPI files in klaviyo/openapi. Two fields there disagree with what the live API actually sends. I filed this on the repo as issue #5 a couple of days ago but haven't had a reply, so reposting here in case this is the better place for it.

https://github.com/klaviyo/openapi/issues/5

Worth saying up front: the nullable flags in the spec don't look like a blanket setting. 331 of 1171 properties in the profiles bundle carry nullable: true, and they differ between neighbouring fields - website_url is nullable, organization_name right next to it isn't. So we've been treating them as deliberate, which is why the two below look like per-field bugs rather than us misreading the dialect.

1. links.next comes back as an explicit null, but the schema doesn't allow it

CollectionLinks declares next as a plain string with uri format - optional, not nullable. On the last page the API sends the key anyway with a null value rather than leaving it out. Straight off GET /api/segments:

"links":{"self":"https://a.klaviyo.com/api/segments","next":null,"prev":null}

The spec is OpenAPI 3.0.2, so null has to be opted into per field. A client generated from or validated against these files rejects the final page of every collection. Adding nullable: true to next and prev would sort it.

2. organization_name is required and non-nullable in the spec, but comes back null

In openapi/stable/apis/get_accounts.json, ContactInformation lists organization_name as required and gives it no nullable flag, unlike website_url beside it. GET /api/accounts returns "organization_name": null on an account that hasn't got one set. Either nullable: true or dropping it from required would fix it, whichever matches what you intended.

3. And a question - can a profile come back with no id?

get_profiles.json declares the data item as required [type, attributes, links], with no id, and id itself as nullable: true. We've handled both cases defensively, but is a profile without an id something that actually happens? If it can't, tightening the spec would let clients just rely on the field being there.

Happy to share request and response details on any of these.

Best answer by Meghan F.

Hi Alan, 
Thank you for sharing these details and questions! I am going to create an additional support ticket for this inquiry from the account details you have previously shared with me. 

In the meantime, our team did confirm the answer to your third question: 

3. Can a profile come back with no id? — No, this can't happen in practice. id is always populated in a profile response. The looser typing in the spec comes from the same schema being shared between request bodies (where id is legitimately absent on profile creation) and responses (where it's always present). That's spec looseness rather than a live behavior difference, but it's fair feedback, we'll look at tightening it so the response schema doesn't inherit the request schema's flexibility.


Keep an eye on your email for follow up on your other questions! 

1 reply

Meghan F.Answer
Community Manager
September 14, 2026

Hi Alan, 
Thank you for sharing these details and questions! I am going to create an additional support ticket for this inquiry from the account details you have previously shared with me. 

In the meantime, our team did confirm the answer to your third question: 

3. Can a profile come back with no id? — No, this can't happen in practice. id is always populated in a profile response. The looser typing in the spec comes from the same schema being shared between request bodies (where id is legitimately absent on profile creation) and responses (where it's always present). That's spec looseness rather than a live behavior difference, but it's fair feedback, we'll look at tightening it so the response schema doesn't inherit the request schema's flexibility.


Keep an eye on your email for follow up on your other questions!