Skip to content

GraphQL API

Homecast exposes two GraphQL endpoints:

EndpointAuthPurpose
GET/POST /JWTWeb and mobile app (first-party)
GET/POST /graphqlOAuth / TokenProgrammatic access

Both serve the same schema. Use /graphql with access tokens or OAuth for integrations.

bash
curl -X POST https://api.homecast.cloud/graphql \
  -H "Authorization: Bearer hc_your_token" \
  -H "Content-Type: application/json" \
  -d '{"query": "{ homes { id name } }"}'

Field name convention

All field names are camelCase in GraphQL (e.g., homeMembers, accessTokens). Python source uses snake_case which is auto-converted.

Auth & Account

Queries

FieldReturnsDescription
meUserInfoCurrent user profile
accountAccountInfoAccount type, subscription status
settingsUserSettingsUser settings JSON
healthStringServer health check

Mutations

FieldParametersReturnsDescription
signupemail, password, name?AuthResultCreate account
loginemail, passwordAuthResultSign in
verifyEmailtokenAuthResultVerify email address
resendVerificationEmailemailAuthResultResend verification
updateSettingsdata (JSON string)UpdateSettingsResultUpdate user settings
createCheckoutSessionregion?CheckoutSessionResultStart Stripe checkout
createPortalSessionPortalSessionResultOpen billing portal

Types

graphql
type AuthResult {
  success: Boolean!
  token: String
  user: UserInfo
  error: String
}

type UserInfo {
  id: String!
  email: String!
  name: String
  accountType: String!
  emailVerified: Boolean!
}

Homes & Rooms

Queries

FieldParametersReturnsDescription
homes[HomeKitHome]All accessible homes
cachedHomes[CachedHome]Cached homes with relay status
roomshomeId[HomeKitRoom]Rooms in a home
zoneshomeId[HomeKitZone]Zones in a home
serviceGroupshomeId[HomeKitServiceGroup]Service groups
sceneshomeId[HomeKitScene]Scenes in a home

Types

graphql
type HomeKitHome {
  id: String!
  name: String!
  role: String       # owner, admin, control, view
}

type CachedHome {
  homeId: String!
  name: String!
  role: String
  isConnected: Boolean
  memberCount: Int
}

type HomeKitRoom {
  id: String!
  name: String!
  homeId: String!
}

type HomeKitScene {
  id: String!
  name: String!
  homeId: String!
}

Accessories & Control

Queries

FieldParametersReturnsDescription
accessorieshomeId?, roomId?[HomeKitAccessory]List accessories
accessoryaccessoryId, homeId?HomeKitAccessoryGet single accessory
characteristicGetaccessoryId, characteristicType, homeId?CharacteristicValueRead a characteristic

Mutations

FieldParametersReturnsDescription
setCharacteristicaccessoryId, characteristicType, value, homeId?SetCharacteristicResultSet a device characteristic
setServiceGrouphomeId, groupId, characteristicType, valueSetServiceGroupResultControl all devices in a group
executeScenesceneId, homeId?ExecuteSceneResultExecute a HomeKit scene

Types

graphql
type HomeKitAccessory {
  id: String!
  name: String!
  homeId: String!
  roomId: String!
  category: String
  reachable: Boolean!
  services: [HomeKitService!]!
}

type HomeKitService {
  id: String!
  type: String!
  name: String
  characteristics: [HomeKitCharacteristic!]!
}

type HomeKitCharacteristic {
  type: String!
  value: JSON
  description: String
  format: String
  unit: String
  minValue: Float
  maxValue: Float
  minStep: Float
  validValues: [String]
  canRead: Boolean!
  canWrite: Boolean!
}

type SetCharacteristicResult {
  success: Boolean!
  value: JSON
  error: String
}

Collections & Layout

Queries

FieldParametersReturnsDescription
storedEntitiesentityType[StoredEntityInfo]List stored entities
storedEntityLayoutentityType, entityIdStoredEntityInfoGet entity layout

Mutations

FieldParametersReturnsDescription
syncEntitiesentities (JSON array)SyncEntitiesResultSync entity data
updateStoredEntityLayoutentityType, entityId, layoutJsonUpdateEntityLayoutResultUpdate layout

Home Members

Queries

FieldParametersReturnsDescription
homeMembershomeId[HomeMemberInfo]Members of a home
mySharedHomes[CachedHome]Homes shared with me
pendingInvitations[PendingInvitation]My pending invitations

Mutations

FieldParametersReturnsDescription
inviteHomeMemberhomeId, email, roleHomeMemberResultInvite by email
updateHomeMemberRolehomeId, email, roleHomeMemberResultChange member role
removeHomeMemberhomeId, emailHomeMemberResultRemove a member
acceptPendingInvitationinvitationIdHomeMemberResultAccept an invitation
rejectPendingInvitationinvitationIdHomeMemberResultReject an invitation

Types

graphql
type HomeMemberInfo {
  id: String!
  homeId: String!
  email: String!
  role: String!          # admin, control, view
  isPending: Boolean!
  createdAt: String!
  name: String
}

type PendingInvitation {
  id: String!
  homeId: String!
  homeName: String
  role: String!
  inviterName: String
  createdAt: String!
}

Entity Sharing

Queries

FieldParametersReturnsDescription
sharingInfoentityType, entityIdSharingInfoSharing summary for an entity
entityAccessentityType, entityId[EntityAccessInfo]Access entries for an entity
mySharedEntities[EntityAccessInfo]Entities I've shared
publicEntityshareHash, passcode?SharedEntityDataGet shared entity (no auth)
publicEntityAccessoriesshareHash, passcode?[HomeKitAccessory]Accessory data for shared entity

Mutations

FieldParametersReturnsDescription
createEntityAccessentityType, entityId, accessType, role?, homeId?, userEmail?, passcode?, name?, accessSchedule?CreateEntityAccessResultShare an entity
updateEntityAccessaccessId, role?, passcode?, name?, accessSchedule?CreateEntityAccessResultUpdate sharing
deleteEntityAccessaccessIdDeleteEntityAccessResultRemove sharing
publicEntitySetCharacteristicshareHash, passcode?, accessoryId, characteristicType, valuePublicEntitySetResultControl via share link

Access Tokens

Queries

FieldParametersReturnsDescription
accessTokens[AccessTokenInfo]List all tokens

Mutations

FieldParametersReturnsDescription
createAccessTokenname, homePermissions, expiresAt?CreateAccessTokenResultCreate a token
revokeAccessTokentokenIdRevokeAccessTokenResultRevoke a token

Webhooks

Queries

FieldParametersReturnsDescription
webhooks[WebhookInfo]List all webhooks
webhookwebhookIdWebhookInfoGet single webhook
webhookEventTypes[WebhookEventTypeInfo]Available event types
webhookDeliveryHistorywebhookId, offset?, limit?DeliveryHistoryResultDelivery history

Mutations

FieldParametersReturnsDescription
createWebhookname, url, eventTypes?, homeIds?, roomIds?, accessoryIds?, collectionIds?, maxRetries?, rateLimitPerMinute?, timeoutMs?CreateWebhookResultCreate a webhook
updateWebhookwebhookId, name?, url?, eventTypes?, homeIds?, roomIds?, accessoryIds?, collectionIds?, maxRetries?, rateLimitPerMinute?, timeoutMs?UpdateWebhookResultUpdate a webhook
deleteWebhookwebhookIdDeleteWebhookResultDelete a webhook
pauseWebhookwebhookIdUpdateWebhookResultPause deliveries
resumeWebhookwebhookIdUpdateWebhookResultResume deliveries
rotateWebhookSecretwebhookIdRotateSecretResultRotate signing secret
testWebhookwebhookIdTestWebhookResultSend test delivery

Types

graphql
type WebhookInfo {
  id: String!
  name: String!
  url: String!
  secretPrefix: String!
  status: String!           # active, paused, disabled
  eventTypes: [String!]!
  homeIds: [String!]!
  roomIds: [String!]!
  accessoryIds: [String!]!
  collectionIds: [String!]!
  maxRetries: Int!
  rateLimitPerMinute: Int
  timeoutMs: Int!
  consecutiveFailures: Int!
  lastTriggeredAt: String
  lastSuccessAt: String
  lastFailureAt: String
  createdAt: String
}

OAuth Apps

Queries

FieldParametersReturnsDescription
authorizedApps[AuthorizedAppInfo]OAuth apps with access

Mutations

FieldParametersReturnsDescription
revokeAuthorizedAppclientIdRevokeAuthorizedAppResultRevoke app access

Sessions

Queries

FieldParametersReturnsDescription
sessions[SessionInfo]Active sessions
sessiondeviceIdSessionInfoGet single session
connectionDebugInfoConnectionDebugInfoDebug info

Mutations

FieldParametersReturnsDescription
removeSessiondeviceIdBooleanRemove a session

Backgrounds

Queries

FieldParametersReturnsDescription
backgroundPresets[BackgroundPresetInfo]Available preset backgrounds
userBackgrounds[UserBackgroundInfo]User's uploaded backgrounds

Examples

Read all accessories in a home

graphql
{
  homes {
    id
    name
    rooms {
      id
      name
      accessories {
        id
        name
        category
        reachable
        services {
          type
          characteristics {
            type
            value
          }
        }
      }
    }
  }
}

Set a device characteristic

graphql
mutation {
  setCharacteristic(
    accessoryId: "acc-uuid"
    characteristicType: "brightness"
    value: "50"
    homeId: "home-uuid"
  ) {
    success
    value
    error
  }
}

Create an access token

graphql
mutation {
  createAccessToken(
    name: "My Script"
    homePermissions: "{\"home-uuid\": \"control\"}"
  ) {
    success
    rawToken
    error
  }
}

Create a webhook

graphql
mutation {
  createWebhook(
    name: "State logger"
    url: "https://my-server.com/webhook"
    eventTypes: ["state.changed"]
    homeIds: ["home-uuid"]
  ) {
    success
    webhook {
      id
      name
      secretPrefix
    }
    error
  }
}

List shared homes

graphql
{
  mySharedHomes {
    homeId
    name
    role
  }
}

See API Errors for error response formats and common issues.